private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     recarregaLlistaEmpleats();
     btnDeleteProj.IsEnabled = false;
     btnAddProj.IsEnabled    = false;
     EstatButton             = Estat.SENSE_CANVIS;
 }
Exemple #2
0
 /// <summary>
 /// Creates an Achievement. You must also mirror the data provided here in https://partner.steamgames.com/apps/achievements/yourappid
 /// </summary>
 /// <param name="achievement">The "API Name Progress Stat" used to uniquely identify the achievement.</param>
 /// <param name="name">The "Display Name" that will be shown to players in game and on the Steam Community.</param>
 /// <param name="desc">The "Description" that will be shown to players in game and on the Steam Community.</param>
 public AchievementInfo(Eachievement achievementID, Estat statID, string name, string desc, int protoId)
 {
     m_eAchievementID = achievementID;
     m_eStatID        = statID;
     m_apiName        = name;
     m_strDescription = desc;
     m_bAchieved      = false;
     m_ProtoId        = protoId;
 }
 private void estatButtons(Estat estat)
 {
     if (estat == Estat.SENSE_CANVIS)
     {
         btnCancel.Visibility = Visibility.Collapsed;
         btnSave.Visibility   = Visibility.Collapsed;
     }
     else if (estat == Estat.AMB_CANVIS)
     {
         btnCancel.Visibility = Visibility.Visible;
         btnSave.Visibility   = Visibility.Visible;
     }
 }
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     lsvTeams.ItemsSource   = TeamsDB.getTeams();
     lsvTeams.SelectedIndex = 0;
     if (CircuitDB.getClosedRaces() > 0)
     {
         EstatForm = Estat.CURSA_TANCADA;
     }
     else
     {
         EstatForm = Estat.SENSE_CANVIS;
     }
 }
Exemple #5
0
        public Estat ComprovaEstat()
        {
            bool     estaBe = true;
            Estat    estat  = Estat.Normal;
            TimeSpan tempsEstaBe;

            if (Obert)
            {
                estaBe = DateTime.Now - DataQueEsVaObrir < producte.TempsUnCopObert;
                if (!estaBe)
                {
                    if (UnitatCaducada != null)
                    {
                        UnitatCaducada(this);
                    }
                    estat = Estat.Caducat;
                }
            }
            else
            {
                tempsEstaBe = DataCaducitat - DateTime.Now;
                if (tempsEstaBe < new TimeSpan())
                {
                    if (UnitatCaducada != null)
                    {
                        UnitatCaducada(this);
                    }
                    estaBe = false;
                    estat  = Estat.Caducat;
                }
                else if (tempsEstaBe < producte.TempsAvisPerCaducar)
                {
                    if (UnitatApuntDeCaducar != null)
                    {
                        UnitatApuntDeCaducar(this);
                    }
                    estat = Estat.ApuntDeCaducar;
                }
            }

            return(estat);
        }
Exemple #6
0
    private void LoadAchievement(string str)
    {
        XmlDocument  doc    = new XmlDocument();
        StringReader reader = new StringReader(str);

        if (doc == null || reader == null)
        {
            return;
        }

        doc.Load(reader);
        XmlNode root      = doc.SelectSingleNode("AchievementData");
        XmlNode achNode   = root.SelectSingleNode("Achievements");
        XmlNode statsNode = root.SelectSingleNode("Stats");

        //Achievements
        XmlNodeList _AchDataList  = ((XmlElement)achNode).GetElementsByTagName("TriggerData");
        XmlNodeList _statDataList = ((XmlElement)statsNode).GetElementsByTagName("Data");

        int _achCount  = _AchDataList.Count;
        int _statCount = _statDataList.Count;

        m_Achievements = new AchievementInfo[_achCount];
        m_MissionAchs  = new MissionAchievement[_achCount];

        m_StatNames = new string[1 + _statCount];
        m_Stats     = new Istat[_achCount];

        foreach (XmlNode node in _AchDataList)
        {
            XmlElement   xe             = node as XmlElement;
            int          _achid         = PETools.XmlUtil.GetAttributeInt32(xe, "achID");
            int          _staid         = PETools.XmlUtil.GetAttributeInt32(xe, "staID");
            Eachievement _achievementID = (Eachievement)_achid;
            Estat        _statID        = (Estat)_staid;
            string       _name          = PETools.XmlUtil.GetAttributeString(xe, "APIname");
            string       _desc          = PETools.XmlUtil.GetAttributeString(xe, "AchieveDesc");
            int          _missionid     = PETools.XmlUtil.GetAttributeInt32(xe, "MissionID");
            MissionAchievement.Emisschedule _accomplishOrGet = (MissionAchievement.Emisschedule)PETools.XmlUtil.GetAttributeInt32(xe, "AccomplishOrGet");
            int _protoId = PETools.XmlUtil.GetAttributeInt32(xe, "ItemProtoId");

            m_Achievements[_achid] = (new AchievementInfo(_achievementID, _statID, _name, _desc, _protoId));

            m_StatNames[_staid] = "";
            TriggerStat mstat = new TriggerStat();
            mstat.SetGoal(1);
            m_Stats[_achid] = mstat;

            m_MissionAchs[_achid] = new MissionAchievement(_missionid, _accomplishOrGet);
        }

        //stats
        foreach (XmlNode node in _statDataList)
        {
            XmlElement xe     = node as XmlElement;
            int        _id    = PETools.XmlUtil.GetAttributeInt32(xe, "ID");
            int        _achid = PETools.XmlUtil.GetAttributeInt32(xe, "achID");
            string     _name  = PETools.XmlUtil.GetAttributeString(xe, "StatName");
            int        _goal  = PETools.XmlUtil.GetAttributeInt32(xe, "Goal");

            if (m_Stats.Length > _achid && m_Stats[_achid] != null)
            {
                m_Stats[_achid].SetGoal(_goal);
            }

            m_StatNames[_id] = _name;
        }
    }
        private void estatsFormulari(Estat estat)
        {
            if (estat == Estat.NO_SELECCIONAT)
            {
                gdvPilotsTeam.IsEnabled = true;

                btnDelete.IsEnabled = false;

                btnAdd.IsEnabled = true;

                txtTeamName.IsEnabled           = false;
                txtFullName.IsEnabled           = false;
                txtTeamChief.IsEnabled          = false;
                txtChassis.IsEnabled            = false;
                txtPowerUnit.IsEnabled          = false;
                txtFirstTeamEntry.IsEnabled     = false;
                txtWorldChampionships.IsEnabled = false;
                txtFastestLaps.IsEnabled        = false;
                txtDesc.IsEnabled = false;

                btnUPFirstTeamEntry.IsEnabled       = false;
                btnDownFirstTeamEntry.IsEnabled     = false;
                btnUPWorldChampionships.IsEnabled   = false;
                btnDownWorldChampionships.IsEnabled = false;
                btnUPFastestLaps.IsEnabled          = false;
                btnDownFastestLaps.IsEnabled        = false;
                btnPickLogo.IsEnabled = false;
                btnPickCar.IsEnabled  = false;

                btnAssignedPilot.IsEnabled = false;

                btnCancel.IsEnabled = false;

                btnSave.IsEnabled = false;

                gdvPilotsTeam.IsEnabled = true;
            }
            else if (estat == Estat.SENSE_CANVIS)
            {
                gdvPilotsTeam.IsEnabled = true;

                btnDelete.IsEnabled = true;

                btnAdd.IsEnabled = true;

                txtTeamName.IsEnabled           = true;
                txtFullName.IsEnabled           = true;
                txtTeamChief.IsEnabled          = true;
                txtChassis.IsEnabled            = true;
                txtPowerUnit.IsEnabled          = true;
                txtFirstTeamEntry.IsEnabled     = true;
                txtWorldChampionships.IsEnabled = true;
                txtFastestLaps.IsEnabled        = true;
                txtDesc.IsEnabled = true;

                btnUPFirstTeamEntry.IsEnabled       = true;
                btnDownFirstTeamEntry.IsEnabled     = true;
                btnUPWorldChampionships.IsEnabled   = true;
                btnDownWorldChampionships.IsEnabled = true;
                btnUPFastestLaps.IsEnabled          = true;
                btnDownFastestLaps.IsEnabled        = true;
                btnPickLogo.IsEnabled = true;
                btnPickCar.IsEnabled  = true;

                activeButtonAssignedPilot();

                btnCancel.IsEnabled = false;

                btnSave.IsEnabled = false;
            }
            else if (estat == Estat.MODIFICAT)
            {
                /*
                 * Per sol·lucionar que quan esta en estat SENSE_CANVIS i mostra alguna cosa al formulari,
                 * detecta com si hi hagues algun canvi al Team i per tant, pasa pel Team_PropertyChanged,
                 * i es canvia l'estat a MODIFICAT quan tindria que estar a SENSE_CANVIS, per solucionar això,
                 * he posat el Boto Detele i el Add a IsEnable = true, quan tindrien que estar a false, ja que
                 * si s'ha modificat no ens interesa esborrar o crear un de nou, pero es per solucionar aquesta errada.
                 */
                gdvPilotsTeam.IsEnabled = true;

                btnDelete.IsEnabled = true;

                btnAdd.IsEnabled = true;

                txtTeamName.IsEnabled           = true;
                txtFullName.IsEnabled           = true;
                txtTeamChief.IsEnabled          = true;
                txtChassis.IsEnabled            = true;
                txtPowerUnit.IsEnabled          = true;
                txtFirstTeamEntry.IsEnabled     = true;
                txtWorldChampionships.IsEnabled = true;
                txtFastestLaps.IsEnabled        = true;
                txtDesc.IsEnabled = true;

                btnUPFirstTeamEntry.IsEnabled       = true;
                btnDownFirstTeamEntry.IsEnabled     = true;
                btnUPWorldChampionships.IsEnabled   = true;
                btnDownWorldChampionships.IsEnabled = true;
                btnUPFastestLaps.IsEnabled          = true;
                btnDownFastestLaps.IsEnabled        = true;
                btnPickLogo.IsEnabled = true;
                btnPickCar.IsEnabled  = true;

                activeButtonAssignedPilot();

                btnCancel.IsEnabled = true;

                btnSave.IsEnabled = true;
            }
            else if (estat == Estat.NOU)
            {
                gdvPilotsTeam.IsEnabled = true;

                btnDelete.IsEnabled = false;

                btnAdd.IsEnabled = false;

                txtTeamName.IsEnabled           = true;
                txtFullName.IsEnabled           = true;
                txtTeamChief.IsEnabled          = true;
                txtChassis.IsEnabled            = true;
                txtPowerUnit.IsEnabled          = true;
                txtFirstTeamEntry.IsEnabled     = true;
                txtWorldChampionships.IsEnabled = true;
                txtFastestLaps.IsEnabled        = true;
                txtDesc.IsEnabled = true;

                btnUPFirstTeamEntry.IsEnabled       = true;
                btnDownFirstTeamEntry.IsEnabled     = true;
                btnUPWorldChampionships.IsEnabled   = true;
                btnDownWorldChampionships.IsEnabled = true;
                btnUPFastestLaps.IsEnabled          = true;
                btnDownFastestLaps.IsEnabled        = true;
                btnPickLogo.IsEnabled = true;
                btnPickCar.IsEnabled  = true;

                btnAssignedPilot.IsEnabled = false;

                btnCancel.IsEnabled = true;

                btnSave.IsEnabled = true;
            }
            else if (estat == Estat.CURSA_TANCADA)
            {
                gdvPilotsTeam.IsEnabled = false;

                btnDelete.IsEnabled = false;

                btnAdd.IsEnabled = false;

                txtTeamName.IsEnabled           = false;
                txtFullName.IsEnabled           = false;
                txtTeamChief.IsEnabled          = false;
                txtChassis.IsEnabled            = false;
                txtPowerUnit.IsEnabled          = false;
                txtFirstTeamEntry.IsEnabled     = false;
                txtWorldChampionships.IsEnabled = false;
                txtFastestLaps.IsEnabled        = false;
                txtDesc.IsEnabled = false;

                btnUPFirstTeamEntry.IsEnabled       = false;
                btnDownFirstTeamEntry.IsEnabled     = false;
                btnUPWorldChampionships.IsEnabled   = false;
                btnDownWorldChampionships.IsEnabled = false;
                btnUPFastestLaps.IsEnabled          = false;
                btnDownFastestLaps.IsEnabled        = false;
                btnPickLogo.IsEnabled = false;
                btnPickCar.IsEnabled  = false;

                btnAssignedPilot.IsEnabled = false;

                btnCancel.IsEnabled = false;

                btnSave.IsEnabled = false;
            }
        }