예제 #1
0
        public StaffSearchAttributes()
        {
            InitializeComponent();

            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();
            setDataContext();
        }
예제 #2
0
        public WindowLoading(WindowMain windowMain)
        {
            InitializeComponent();

            context         = ScoutContext.getScoutContext();
            globalFuncs     = Globals.getGlobalFuncs();
            this.windowMain = windowMain;
        }
예제 #3
0
        public PlayerSearchAttributes()
        {
            this.InitializeComponent();

            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();
            setDataContext();
        }
예제 #4
0
        public WindowInfo()
        {
            InitializeComponent();

            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();

            setDataContext();

            this.ButtonClose.Click += new RoutedEventHandler(ButtonClose_Click);
            this.MouseDown         += new System.Windows.Input.MouseButtonEventHandler(WindowInfo_MouseDown);
        }
        public WindowQuickColumns()
        {
            this.InitializeComponent();

            settings    = GlobalSettings.getSettings();
            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();

            setDataContext();

            this.ButtonDefault.Click += new RoutedEventHandler(ButtonDefault_Click);
            this.ButtonClose.Click   += new RoutedEventHandler(ButtonClose_Click);
            //this.MouseDown += new System.Windows.Input.MouseButtonEventHandler(WindowInfo_MouseDown);

            defaultColumns = new List <int>();
        }
예제 #6
0
        public ShortlistTabItem()
        {
            this.InitializeComponent();
            this.progressBar.Opacity = 0;

            settings    = GlobalSettings.getSettings();
            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();
            setDataContext();

            this.ButtonColumns.Click         += new RoutedEventHandler(ButtonColumns_Click);
            this.dataGrid.SelectionChanged   += new SelectionChangedEventHandler(dataGrid_SelectionChanged);
            this.dataGrid.MouseDoubleClick   += new MouseButtonEventHandler(dataGrid_MouseDoubleClick);
            this.dataGrid.MouseLeftButtonUp  += new MouseButtonEventHandler(dataGrid_MouseLeftButtonUp);
            this.dataGrid.MouseRightButtonUp += new MouseButtonEventHandler(dataGrid_MouseRightButtonUp);
        }
예제 #7
0
        public void setProfileViewModel(ref Staff staff, ref StaffGridViewModel r)
        {
            settings    = GlobalSettings.getSettings();
            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();

            this.SelectionButton           = new CheckBoxContext();
            this.SelectionButton.IsChecked = true;

            int index = ScoutLocalization.SR_STAFFCOLUMNDEPTH;

            contexts = new List <LabeledTextBoxContext>();
            for (int i = index; i < globalFuncs.localization.staffColumns.Count; ++i)
            {
                LabeledTextBoxContext _context = new LabeledTextBoxContext();
                setAttributeContext(ref _context);
                contexts.Add(_context);
            }

            contextsratings = new List <LabeledImageContext>();
            for (int i = 1; i < globalFuncs.localization.bestcrs.Count; ++i)
            {
                LabeledImageContext _context = new LabeledImageContext();
                contextsratings.Add(_context);
            }

            contractstarted  = new LabeledTextBoxContext();
            contractexpiring = new LabeledTextBoxContext();
            wage             = new LabeledTextBoxContext();

            this.tacticalattributes    = new LabeledHeaderContext();
            this.mentalattributes      = new LabeledHeaderContext();
            this.coachingattributes    = new LabeledHeaderContext();
            this.nontacticalattributes = new LabeledHeaderContext();
            this.chairmanattributes    = new LabeledHeaderContext();
            this.personaldetails       = new LabeledHeaderContext();
            this.contractdetails       = new LabeledHeaderContext();
            this.ratings = new LabeledHeaderContext();

            setProfileContext(contractstarted);
            setProfileContext(contractexpiring);
            setProfileContext(wage);

            setControlValues(ref staff, ref r);
            setLocalization();
        }
        public TeamSearchTabItem()
        {
            this.InitializeComponent();
            this.progressBar.Opacity = 0;

            settings    = GlobalSettings.getSettings();
            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();

            searchUI = new SearchUITeam();

            this.teamtype.Visibility = Visibility.Collapsed;

            setDataContext();

            this.ButtonSearch.Click         += new RoutedEventHandler(ButtonSearch_Click);
            this.ButtonWonder.Click         += new RoutedEventHandler(ButtonWonder_Click);
            this.ButtonColumns.Click        += new RoutedEventHandler(ButtonColumns_Click);
            this.dataGrid.MouseDoubleClick  += new MouseButtonEventHandler(dataGrid_MouseDoubleClick);
            this.dataGrid.MouseLeftButtonUp += new MouseButtonEventHandler(dataGrid_MouseLeftButtonUp);
        }
예제 #9
0
        public WindowMain()
        {
            Type ownerType = typeof(Window);

            // Load
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(LoadCommand, new KeyGesture(Key.L, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(LoadCommand, new ExecutedRoutedEventHandler(OnExecutedLoad)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ExitCommand, new KeyGesture(Key.X, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ExitCommand, new ExecutedRoutedEventHandler(OnExecutedExit)));
            // Shortlist
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ImportCommand, new KeyGesture(Key.Q, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ImportCommand, new ExecutedRoutedEventHandler(OnExecutedImport)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ExportCommand, new KeyGesture(Key.W, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ExportCommand, new ExecutedRoutedEventHandler(OnExecutedExport)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ExportSelectedCommand, new KeyGesture(Key.E, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ExportSelectedCommand, new ExecutedRoutedEventHandler(OnExecutedExportSelected)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(AddCommand, new KeyGesture(Key.R, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(AddCommand, new ExecutedRoutedEventHandler(OnExecutedAdd)));
            // View
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ViewPlayersCommand, new KeyGesture(Key.A, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ViewPlayersCommand, new ExecutedRoutedEventHandler(OnExecutedViewPlayers)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ViewStaffCommand, new KeyGesture(Key.S, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ViewStaffCommand, new ExecutedRoutedEventHandler(OnExecutedViewStaff)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ViewTeamsCommand, new KeyGesture(Key.D, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ViewTeamsCommand, new ExecutedRoutedEventHandler(OnExecutedViewTeams)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ViewShortlistCommand, new KeyGesture(Key.F, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ViewShortlistCommand, new ExecutedRoutedEventHandler(OnExecutedViewShortlist)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(SearchNowCommand, new KeyGesture(Key.Enter)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(SearchNowCommand, new ExecutedRoutedEventHandler(OnExecutedSearchNow)));
            // Clear
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ClearPlayersCommand, new KeyGesture(Key.Z, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ClearPlayersCommand, new ExecutedRoutedEventHandler(OnExecutedClearPlayers)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ClearStaffCommand, new KeyGesture(Key.X, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ClearStaffCommand, new ExecutedRoutedEventHandler(OnExecutedClearStaff)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ClearTeamsCommand, new KeyGesture(Key.C, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ClearTeamsCommand, new ExecutedRoutedEventHandler(OnExecutedClearTeams)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ClearShortlistCommand, new KeyGesture(Key.B, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ClearShortlistCommand, new ExecutedRoutedEventHandler(OnExecutedClearShortlist)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ClearAllCommand, new KeyGesture(Key.N, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ClearAllCommand, new ExecutedRoutedEventHandler(OnExecutedClearAll)));
            // Tools
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(ToolsCommand, new KeyGesture(Key.T, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(ToolsCommand, new ExecutedRoutedEventHandler(OnExecutedTools)));
            // Help
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(AboutCommand, new KeyGesture(Key.H, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(AboutCommand, new ExecutedRoutedEventHandler(OnExecutedAbout)));
            CommandManager.RegisterClassInputBinding(ownerType, new InputBinding(DonateCommand, new KeyGesture(Key.P, ModifierKeys.Control)));
            CommandManager.RegisterClassCommandBinding(ownerType, new CommandBinding(DonateCommand, new ExecutedRoutedEventHandler(OnExecutedDonate)));

            InitializeComponent();

            context                = ScoutContext.getScoutContext();
            globalFuncs            = Globals.getGlobalFuncs();
            globalFuncs.windowMain = this;

            setDataContext();

            settings = GlobalSettings.getSettings();
            settings.init();

            this.PlayerSearch.attributes        = this.PlayerSearchAttributes;
            this.StaffSearch.attributes         = this.StaffSearchAttributes;
            this.ButtonCurrentScreen.Click     += new RoutedEventHandler(ButtonCurrentScreen_Click);
            this.ButtonInformationScreen.Click += new RoutedEventHandler(ButtonInformationScreen_Click);

            this.PlayerSearch.windowMain = this;
            this.StaffSearch.windowMain  = this;
            this.TeamSearch.windowMain   = this;
            this.Shortlist.windowMain    = this;
            //this.PlayerSearch.progressBar.Opacity = 1;
            globalFuncs.shortlistSelected   = TryFindResource("shortlisted") as ImageSource;
            globalFuncs.shortlistUnselected = TryFindResource("nshortlisted") as ImageSource;

            reset(false);
            initDataTableColumns();
            clearAllFields();

            this.TabControl.SelectionChanged += new SelectionChangedEventHandler(TabControlSelectionChanged);
            this.MouseUp += new MouseButtonEventHandler(WindowMain_MouseUp);
        }
예제 #10
0
        public void setProfileViewModel(ref Team team, ref TeamGridViewModel r)
        {
            settings    = GlobalSettings.getSettings();
            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();

            this.SelectionButton           = new CheckBoxContext();
            this.SelectionButton.IsChecked = true;

            yearfounded        = new LabeledTextBoxContext();
            national           = new LabeledTextBoxContext();
            status             = new LabeledTextBoxContext();
            maxafclubs         = new LabeledTextBoxContext();
            afclubs            = new LabeledTextBoxContext();
            trainingfacilities = new LabeledTextBoxContext();
            youthfacilities    = new LabeledTextBoxContext();
            youthacademy       = new LabeledTextBoxContext();
            maxattendance      = new LabeledTextBoxContext();
            averageattendance  = new LabeledTextBoxContext();
            minattendance      = new LabeledTextBoxContext();
            reputation         = new LabeledTextBoxContext();

            totaltransfer    = new LabeledTextBoxContext();
            remtransfer      = new LabeledTextBoxContext();
            balance          = new LabeledTextBoxContext();
            totalwage        = new LabeledTextBoxContext();
            usedwage         = new LabeledTextBoxContext();
            revenueavailable = new LabeledTextBoxContext();

            decay        = new LabeledTextBoxContext();
            fieldwidth   = new LabeledTextBoxContext();
            fieldlength  = new LabeledTextBoxContext();
            curcapacity  = new LabeledTextBoxContext();
            seatcapacity = new LabeledTextBoxContext();
            expcapacity  = new LabeledTextBoxContext();
            usedcapacity = new LabeledTextBoxContext();

            this.generaldetails = new LabeledHeaderContext();
            this.financedetails = new LabeledHeaderContext();
            this.stadiumdetails = new LabeledHeaderContext();

            setProfileContext(yearfounded);
            setProfileContext(national);
            setProfileContext(status);
            setProfileContext(maxafclubs);
            setProfileContext(afclubs);
            setProfileContext(trainingfacilities);
            setProfileContext(youthfacilities);
            setProfileContext(youthacademy);
            setProfileContext(maxattendance);
            setProfileContext(averageattendance);
            setProfileContext(minattendance);
            setProfileContext(reputation);

            setProfileContext2(totaltransfer);
            setProfileContext2(remtransfer);
            setProfileContext2(balance);
            setProfileContext2(totalwage);
            setProfileContext2(usedwage);
            setProfileContext2(revenueavailable);

            setProfileContext3(decay);
            setProfileContext3(fieldwidth);
            setProfileContext3(fieldlength);
            setProfileContext3(curcapacity);
            setProfileContext3(seatcapacity);
            setProfileContext3(expcapacity);
            setProfileContext3(usedcapacity);

            setControlValues(ref team, ref r);
            setLocalization();
        }
예제 #11
0
        public void setErrorLog(ref Exception e, bool throwExc)
        {
            String    format      = "ddd d/M/yyyy";
            DateTime  dateTimeNow = DateTime.Now;
            String    date        = dateTimeNow.ToString(format);
            String    time        = dateTimeNow.ToLongTimeString();
            String    message     = String.Empty;
            Exception exc         = e;

            while (true)
            {
                //if (exc.Message != null)
                //{
                //    message += Environment.NewLine + "Message: " + exc.Message;
                //}
                //if (exc.StackTrace != null)
                //{
                //    message += Environment.NewLine + "Stacktrace: " + exc.StackTrace;
                //}

                if (exc.InnerException != null)
                {
                    exc = exc.InnerException;
                }
                else
                {
                    if (exc.Message != null)
                    {
                        message += Environment.NewLine + "Message: " + exc.Message;
                    }
                    if (exc.StackTrace != null)
                    {
                        message += Environment.NewLine + "Stacktrace: " + exc.StackTrace;
                    }
                    break;
                }
            }

            String curMsg = String.Empty;

            if (File.Exists(name))
            {
                using (StreamReader sw = new StreamReader(name, Encoding.UTF8))
                {
                    curMsg = sw.ReadToEnd();
                    sw.Close();
                }
            }

            using (StreamWriter sw = new StreamWriter(name, false, Encoding.UTF8))
            {
                string strValue = string.Empty;
                strValue += date + " " + time;
                strValue += Environment.NewLine + "OS: " + System.Environment.OSVersion.VersionString.ToString();
                strValue += Environment.NewLine + "OS type: " + System.Environment.OSVersion.Platform.ToString();
                strValue += Environment.NewLine + "FM Version: " + ScoutContext.getScoutContext().fm.MetaData.CurrentVersion;
                strValue += message;
                //if (!curMsg.Equals(String.Empty)) strValue += Environment.NewLine + Environment.NewLine + curMsg;
                sw.WriteLine(strValue);
                sw.Close();
            }

            System.Diagnostics.Debug.WriteLine(message);

            if (throwExc)
            {
                throw e;
            }
        }
예제 #12
0
 public BadgeService(ScoutContext context)
 {
     _context = context;
     _context.LoadSampleData();
 }
예제 #13
0
 public DatabaseSeeder(ScoutContext context)
 {
     this.context = context;
 }