Example #1
0
	///<summary>
	/// Creates a PTA.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PTA(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new IS(message, 147,"Policy Type");
		data[1] = new IS(message, 193,"Amount Class");
		data[2] = new NM(message,"Money or Percentage Quantity");
		data[3] = new MOP(message,"Money or Percentage");
	}
Example #2
0
File: SCV.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a SCV.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public SCV(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 0,"Parameter class");
     data[1] = new ST(message,"Parameter value");
 }
Example #3
0
	///<summary>
	/// Creates a PPN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PPN(IMessage message, string description) : base(message, description){
		data = new IType[24];
		data[0] = new ST(message,"ID Number");
		data[1] = new FN(message,"Family Name");
		data[2] = new ST(message,"Given Name");
		data[3] = new ST(message,"Second and Further Given Names or Initials Thereof");
		data[4] = new ST(message,"Suffix (e.g., JR or III)");
		data[5] = new ST(message,"Prefix (e.g., DR)");
		data[6] = new IS(message, 360,"Degree (e.g., MD)");
		data[7] = new IS(message, 297,"Source Table");
		data[8] = new HD(message,"Assigning Authority");
		data[9] = new ID(message, 200,"Name Type Code");
		data[10] = new ST(message,"Identifier Check Digit");
		data[11] = new ID(message, 61,"Check Digit Scheme");
		data[12] = new ID(message, 203,"Identifier Type Code");
		data[13] = new HD(message,"Assigning Facility");
		data[14] = new TS(message,"Date/Time Action Performed");
		data[15] = new ID(message, 465,"Name Representation Code");
		data[16] = new CE(message,"Name Context");
		data[17] = new DR(message,"Name Validity Range");
		data[18] = new ID(message, 444,"Name Assembly Order");
		data[19] = new TS(message,"Effective Date");
		data[20] = new TS(message,"Expiration Date");
		data[21] = new ST(message,"Professional Suffix");
		data[22] = new CWE(message,"Assigning Jurisdiction");
		data[23] = new CWE(message,"Assigning Agency or Department");
	}
Example #4
0
File: FC.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a FC.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public FC(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 0,"Financial Class");
     data[1] = new TS(message,"Effective Date");
 }
Example #5
0
File: JCC.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a JCC.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public JCC(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 0,"Job code");
     data[1] = new IS(message, 0,"Job class");
 }
Example #6
0
 ///<summary>
 /// Creates a CM_DTN.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public CM_DTN(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 0,"Day type");
     data[1] = new NM(message,"Number of days");
 }
Example #7
0
	///<summary>
	/// Creates a RMC.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public RMC(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new IS(message, 145,"Room Type");
		data[1] = new IS(message, 146,"Amount Type");
		data[2] = new NM(message,"Coverage Amount");
		data[3] = new MOP(message,"Money or Percentage");
	}
Example #8
0
File: RI.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a RI.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public RI(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 335,"Repeat Pattern");
     data[1] = new ST(message,"Explicit Time Interval");
 }
Example #9
0
 ///<summary>
 /// Creates a CM_PEN.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public CM_PEN(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 0,"Penalty type");
     data[1] = new NM(message,"Penalty amount");
 }
Example #10
0
File: EI.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a EI.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public EI(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Entity identifier");
		data[1] = new IS(message, 300,"Namespace ID");
		data[2] = new ST(message,"Universal ID");
		data[3] = new ID(message, 301,"Universal ID type");
	}
Example #11
0
	///<summary>
	/// Creates a PLN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PLN(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"ID Number");
		data[1] = new IS(message, 338,"Type of ID Number");
		data[2] = new ST(message,"State/other Qualifying Information");
		data[3] = new DT(message,"Expiration Date");
	}
Example #12
0
 ///<summary>
 /// Creates a CM_RI.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public CM_RI(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 0,"Repeat pattern");
     data[1] = new ST(message,"Explicit time interval");
 }
Example #13
0
	///<summary>
	/// Creates a PLN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PLN(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"ID number (ST)");
		data[1] = new IS(message, 0,"Type of ID number (IS)");
		data[2] = new ST(message,"State/other qualifying info");
		data[3] = new DT(message,"Expiration date");
	}
Example #14
0
 ///<summary>
 /// Creates a CM_UVC.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public CM_UVC(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 0,"Value code");
     data[1] = new NM(message,"Value amount");
 }
Example #15
0
File: DLD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a DLD.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public DLD(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new IS(message, 113,"Discharge Location");
     data[1] = new TS(message,"Effective Date");
 }
Example #16
0
File: DLN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a DLN.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public DLN(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new ST(message,"Driver´s License Number");
     data[1] = new IS(message, 0,"Issuing State, province, country");
     data[2] = new DT(message,"Expiration date");
 }
Example #17
0
 ///<summary>
 /// Creates a CM_PI.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public CM_PI(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new ST(message,"ID number (ST)");
     data[1] = new IS(message, 0,"Type of ID number (IS)");
     data[2] = new ST(message,"Other qualifying info");
 }
Example #18
0
File: ICD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a ICD.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public ICD(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new IS(message, 150,"Certification Patient Type");
     data[1] = new ID(message, 136,"Certification Required");
     data[2] = new TS(message,"Date/Time Certification Required");
 }
Example #19
0
 ///<summary>
 /// Creates a CM_PCF.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public CM_PCF(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new IS(message, 0,"Pre-certification patient type");
     data[1] = new ID(message, 0,"Pre-certification required");
     data[2] = new TS(message,"Pre-certification windwow");
 }
Example #20
0
File: DLN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a DLN.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public DLN(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new ST(message,"License Number");
     data[1] = new IS(message, 333,"Issuing State, Province, Country");
     data[2] = new DT(message,"Expiration Date");
 }
Example #21
0
File: HD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a HD.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public HD(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new IS(message, 300,"Namespace ID");
     data[1] = new ST(message,"Universal ID");
     data[2] = new ID(message, 301,"Universal ID Type");
 }
Example #22
0
File: JCC.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a JCC.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public JCC(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new IS(message, 327,"Job Code");
     data[1] = new IS(message, 328,"Job Class");
     data[2] = new TX(message,"Job Description Text");
 }
Example #23
0
 ///<summary>
 /// Creates a CM_PTA.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public CM_PTA(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new IS(message, 147,"Policy type");
     data[1] = new IS(message, 193,"Amount class");
     data[2] = new NM(message,"Amount");
 }
Example #24
0
 ///<summary>
 /// Creates a CM_RMC.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public CM_RMC(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[3];
     data[0] = new IS(message, 145,"Room type");
     data[1] = new IS(message, 0,"Amount type");
     data[2] = new NM(message,"Coverage amount");
 }
Example #25
0
 public override void trigger()
 {
     on = true;
     lastResequenceTime = Time.time;
     state = IS.DisplayingSplash;
     transparency = new Color (0,0,0,0);
     fadeOutColour = new Color (0,0,0,1);
 }
Example #26
0
File: PN.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a PN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PN(IMessage message, string description) : base(message, description){
		data = new IType[6];
		data[0] = new FN(message,"Family+last name");
		data[1] = new ST(message,"Given name");
		data[2] = new ST(message,"Middle initial or name");
		data[3] = new ST(message,"Suffix (e.g., JR or III)");
		data[4] = new ST(message,"Prefix (e.g., DR)");
		data[5] = new IS(message, 0,"Degree (e.g., MD)");
	}
Example #27
0
File: CE.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a CE.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CE(IMessage message, string description) : base(message, description){
		data = new IType[6];
		data[0] = new ST(message,"Identifier (ST)");
		data[1] = new ST(message,"Text");
		data[2] = new IS(message, 0,"Name of coding system");
		data[3] = new ST(message,"Alternate identifier (ST)");
		data[4] = new ST(message,"Alternate text");
		data[5] = new IS(message, 0,"Name of alternate coding system");
	}
Example #28
0
File: CF.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a CF.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CF(IMessage message, string description) : base(message, description){
		data = new IType[6];
		data[0] = new ID(message, 0,"Identifier (ID)");
		data[1] = new FT(message,"Formatted text");
		data[2] = new IS(message, 0,"Name of coding system");
		data[3] = new ID(message, 0,"Alternate identifier (ID)");
		data[4] = new FT(message,"Alternate formatted text");
		data[5] = new IS(message, 0,"Name of alternate coding system");
	}
Example #29
0
File: PN.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a PN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PN(IMessage message, string description) : base(message, description){
		data = new IType[6];
		data[0] = new FN(message,"Family name");
		data[1] = new ST(message,"Given name");
		data[2] = new ST(message,"Second and further given names or initials thereof");
		data[3] = new ST(message,"Suffix (e.g., JR or III)");
		data[4] = new ST(message,"Prefix (e.g., DR)");
		data[5] = new IS(message, 0,"Degree (e.g., MD)");
	}
Example #30
0
File: CX.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a CX.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CX(IMessage message, string description) : base(message, description){
		data = new IType[6];
		data[0] = new ST(message,"ID");
		data[1] = new ST(message,"Check digit");
		data[2] = new ID(message, 0,"Code identifying the check digit scheme employed");
		data[3] = new HD(message,"Assigning authority");
		data[4] = new IS(message, 203,"Identifier type code");
		data[5] = new HD(message,"Assigning facility");
	}
Example #31
0
 /// <summary>
 /// Returns all repetitions of Marital Status (PID-16).
 ///
 /// </summary>
 public IS[] GetMaritalStatus()
 {
     IS[] isArray;
     try
     {
         IType[] field = this.GetField(16);
         isArray = new IS[field.Length];
         for (int index = 0; index < isArray.Length; ++index)
         {
             isArray[index] = (IS)field[index];
         }
     }
     catch (HL7Exception ex)
     {
         HapiLogFactory.GetHapiLog(this.GetType()).Error((object)"Unexpected problem obtaining field value.  This is a bug.", (Exception)ex);
         throw new Exception("An unexpected error ocurred", (Exception)ex);
     }
     catch (Exception ex)
     {
         HapiLogFactory.GetHapiLog(this.GetType()).Error((object)"Unexpected problem obtaining field value.  This is a bug.", ex);
         throw new Exception("An unexpected error ocurred", ex);
     }
     return(isArray);
 }
Example #32
0
        private void TimerClickAsync()
        {
            try
            {
                Dispatcher.BeginInvoke(() =>
                {
                    ClockValue       = ClockValue - new TimeSpan(0, 0, 1);
                    ClockValueString = ClockValue.ToString(@"hh\:mm\:ss");

                    if (ClockValue <= new TimeSpan(0, 0, 5) && ClockValue > new TimeSpan(0, 0, 0))
                    {
                        btnCountdownDisplay.Foreground = new SolidColorBrush(Colors.Red);
                        PlaySound("Assets/alarm.wav");
                    }
                });

                if (ClockValue <= new TimeSpan(0, 0, 0))
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        PlaySound("Assets/beep.wav");

                        MessageBoxResult result = MessageBox.Show(AppResources.ElapsedTime + " " + originalCountdownTime, AppResources.CountdownFinished, MessageBoxButton.OK);
                        if (result == MessageBoxResult.OK)
                        {
                            ResetCountdown(true);
                        }
                    });
                }

                IS.SaveSetting("Countdown-LastValue", ClockValue.ToString());
            }
            catch (Exception)
            {
            }
        }
Example #33
0
        //private void LoadPlayMusicSetting()
        //{
        //    string settingValue = string.Empty;

        //    if (IS.GetSettingStringValue("BabyApp-PlayMusic").ToString() == string.Empty)
        //    {
        //        togglePlayMusic.IsChecked = false;
        //        togglePlayMusic.Content = "Off";
        //    }
        //    else
        //    {
        //        settingValue = IS.GetSettingStringValue("BabyApp-PlayMusic").ToString();
        //        if (settingValue == "On")
        //        {
        //            togglePlayMusic.IsChecked = true;
        //            togglePlayMusic.Content = "On";
        //        }
        //        else
        //        {
        //            togglePlayMusic.IsChecked = false;
        //            togglePlayMusic.Content = "Off";
        //        }
        //    }
        //}

        private void LoadShowTextSetting()
        {
            string settingValue = string.Empty;

            if (IS.GetSettingStringValue("BabyApp-ShowText").ToString() == string.Empty)
            {
                toggleShowText.IsChecked = false;
                toggleShowText.Content   = "Off";
            }
            else
            {
                settingValue = IS.GetSettingStringValue("BabyApp-ShowText").ToString();
                if (settingValue == "On")
                {
                    toggleShowText.IsChecked = true;
                    toggleShowText.Content   = "On";
                }
                else
                {
                    toggleShowText.IsChecked = false;
                    toggleShowText.Content   = "Off";
                }
            }
        }
Example #34
0
        private void LoadPlaySoundSetting()
        {
            string settingValue = string.Empty;

            if (IS.GetSettingStringValue("BabyApp-PlaySounds").ToString() == string.Empty)
            {
                togglePlaySounds.IsChecked = false;
                togglePlaySounds.Content   = "Off";
            }
            else
            {
                settingValue = IS.GetSettingStringValue("BabyApp-PlaySounds").ToString();
                if (settingValue == "On")
                {
                    togglePlaySounds.IsChecked = true;
                    togglePlaySounds.Content   = "On";
                }
                else
                {
                    togglePlaySounds.IsChecked = false;
                    togglePlaySounds.Content   = "Off";
                }
            }
        }
        public virtual void TestLazyPersistFilesAreDiscarded()
        {
            StartUpCluster(true, 2);
            string MethodName = GenericTestUtils.GetMethodName();
            Path   path1      = new Path("/" + MethodName + ".01.dat");

            MakeTestFile(path1, BlockSize, true);
            EnsureFileReplicasOnStorageType(path1, StorageType.RamDisk);
            // Stop the DataNode and sleep for the time it takes the NN to
            // detect the DN as being dead.
            cluster.ShutdownDataNodes();
            Sharpen.Thread.Sleep(30000L);
            Assert.AssertThat(cluster.GetNamesystem().GetNumDeadDataNodes(), IS.Is(1));
            // Next, wait for the replication monitor to mark the file as corrupt
            Sharpen.Thread.Sleep(2 * DfsNamenodeReplicationIntervalDefault * 1000);
            // Wait for the LazyPersistFileScrubber to run
            Sharpen.Thread.Sleep(2 * LazyWriteFileScrubberIntervalSec * 1000);
            // Ensure that path1 does not exist anymore, whereas path2 does.
            System.Diagnostics.Debug.Assert((!fs.Exists(path1)));
            // We should have zero blocks that needs replication i.e. the one
            // belonging to path2.
            Assert.AssertThat(cluster.GetNameNode().GetNamesystem().GetBlockManager().GetUnderReplicatedBlocksCount
                                  (), IS.Is(0L));
        }
Example #36
0
        private void FreeAppInitialIzation()
        {
            if (!_rated && _numberOfTimesOpened >= 2)
            {
                MessageBoxResult result = MessageBox.Show(AppResources.AppMenuItemAddCountdown, AppResources.AppMenuItemAddCountdown, MessageBoxButton.OKCancel);

                if (result == MessageBoxResult.OK)
                {
                    IS.SaveSetting(RATED, true);
                    _rated = true;
                    MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask();
                    marketplaceReviewTask.Show();
                }
            }

            if (Rate.HasAppBeenRated().ToUpper() == "YES")
            {
                EnableCountdown();
            }
            else
            {
                DisableCountdown();
            }
        }
Example #37
0
        /// <summary>Test writes a file and closes it.</summary>
        /// <remarks>
        /// Test writes a file and closes it.
        /// Block reported is generated with an extra block.
        /// Block report is forced and the check for # of pendingdeletion
        /// blocks is performed.
        /// </remarks>
        /// <exception cref="System.IO.IOException">in case of an error</exception>
        public virtual void BlockReport_04()
        {
            string MethodName = GenericTestUtils.GetMethodName();
            Path   filePath   = new Path("/" + MethodName + ".dat");

            DFSTestUtil.CreateFile(fs, filePath, FileSize, ReplFactor, rand.NextLong());
            DataNode dn = cluster.GetDataNodes()[DnN0];
            // all blocks belong to the same file, hence same BP
            string poolId = cluster.GetNamesystem().GetBlockPoolId();
            // Create a bogus new block which will not be present on the namenode.
            ExtendedBlock b = new ExtendedBlock(poolId, rand.NextLong(), 1024L, rand.NextLong
                                                    ());

            dn.GetFSDataset().CreateRbw(StorageType.Default, b, false);
            DatanodeRegistration dnR = dn.GetDNRegistrationForBP(poolId);

            StorageBlockReport[] reports = GetBlockReports(dn, poolId, false, false);
            SendBlockReports(dnR, poolId, reports);
            PrintStats();
            Assert.AssertThat("Wrong number of corrupt blocks", cluster.GetNamesystem().GetCorruptReplicaBlocks
                                  (), IS.Is(0L));
            Assert.AssertThat("Wrong number of PendingDeletion blocks", cluster.GetNamesystem
                                  ().GetPendingDeletionBlocks(), IS.Is(1L));
        }
 public A(IS <T> s)
 {
     this.s = s;
 }
Example #39
0
 public async void UpdateErrorLog(string method, string error)
 {
     await Task.Factory.StartNew(() => WriteErrorToCloud(IS.GetSettingStringValue(USER_ID), method, error));
 }
Example #40
0
        private void LoadLanguageSettings()
        {
            string settingValue = string.Empty;

            try
            {
                if (IS.GetSettingStringValue("BabyApp-English").ToString() == string.Empty)
                {
                    chkEnglish.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-English").ToString();
                    if (settingValue == "Yes")
                    {
                        chkEnglish.IsChecked = true;
                    }
                    else
                    {
                        chkEnglish.IsChecked = false;
                    }
                }

                if (IS.GetSettingStringValue("BabyApp-Spanish").ToString() == string.Empty)
                {
                    chkSpanish.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-Spanish").ToString();
                    if (settingValue == "Yes")
                    {
                        chkSpanish.IsChecked = true;
                    }
                    else
                    {
                        chkSpanish.IsChecked = false;
                    }
                }

                if (IS.GetSettingStringValue("BabyApp-Italian") == string.Empty)
                {
                    chkItalian.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-Italian").ToString();
                    if (settingValue == "Yes")
                    {
                        chkItalian.IsChecked = true;
                    }
                    else
                    {
                        chkItalian.IsChecked = false;
                    }
                }

                if (IS.GetSettingStringValue("BabyApp-French") == string.Empty)
                {
                    chkFrench.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-French").ToString();
                    if (settingValue == "Yes")
                    {
                        chkFrench.IsChecked = true;
                    }
                    else
                    {
                        chkFrench.IsChecked = false;
                    }
                }

                if (IS.GetSettingStringValue("BabyApp-Polish") == string.Empty)
                {
                    chkPolish.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-Polish").ToString();
                    if (settingValue == "Yes")
                    {
                        chkPolish.IsChecked = true;
                    }
                    else
                    {
                        chkPolish.IsChecked = false;
                    }
                }

                if (IS.GetSettingStringValue("BabyApp-German") == string.Empty)
                {
                    chkGerman.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-German").ToString();
                    if (settingValue == "Yes")
                    {
                        chkGerman.IsChecked = true;
                    }
                    else
                    {
                        chkGerman.IsChecked = false;
                    }
                }

                if (IS.GetSettingStringValue("BabyApp-Portuguese") == string.Empty)
                {
                    chkPortuguese.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-Portuguese").ToString();
                    if (settingValue == "Yes")
                    {
                        chkPortuguese.IsChecked = true;
                    }
                    else
                    {
                        chkPortuguese.IsChecked = false;
                    }
                }

                if (IS.GetSettingStringValue("BabyApp-Japanese") == string.Empty)
                {
                    chkJapanese.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-Japanese").ToString();
                    if (settingValue == "Yes")
                    {
                        chkJapanese.IsChecked = true;
                    }
                    else
                    {
                        chkJapanese.IsChecked = false;
                    }
                }

                if (IS.GetSettingStringValue("BabyApp-Chinese").ToString() == string.Empty)
                {
                    chkChinese.IsChecked = false;
                }
                else
                {
                    settingValue = IS.GetSettingStringValue("BabyApp-Chinese").ToString();
                    if (settingValue == "Yes")
                    {
                        chkChinese.IsChecked = true;
                    }
                    else
                    {
                        chkChinese.IsChecked = false;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public StopWatchUserControl()
        {
            InitializeComponent();

            App.gStopWatch           = new Stopwatch();
            _isRunning               = IsStopWatchRunning();
            StopwatchTimesCollection = new ObservableCollection <StopwatchTimes>();

            LoadLapAndSplitData();

            //Need to determine what/if any adjustment should be made to clock
            //For example, if clock was paused previously we want to start at last clock value with clock paused
            //For example, if clock was running previously we want to add time that has accrued since app was shot down
            if ((IS.GetSettingStringValue("Stopwatch-DateTimeLastStart") == string.Empty) || (_isRunning.ToUpper() == "NO"))
            {
                if (IS.GetSettingStringValue("Stopwatch-DateTimeLastStart") == string.Empty)
                {
                    _adjustment = new TimeSpan();
                }
                else
                {
                    if (IS.GetSettingStringValue("Stopwatch-LastValue") == string.Empty)
                    {
                        _adjustment = new TimeSpan();
                    }
                    else
                    {
                        _adjustment = TimeSpan.Parse(IS.GetSettingStringValue("Stopwatch-LastValue"));
                    }
                }
            }
            else  //clock was running when it was last opened, so add accrued time
            {
                _dateTimeLastStart = DateTime.Parse(IS.GetSettingStringValue("Stopwatch-DateTimeLastStart"));
                _adjustment        = TimeSpan.Parse(IS.GetSettingStringValue("Stopwatch-LastValue")) + (DateTime.Now - _dateTimeLastStart);
            }

            _timer          = new DispatcherTimer();
            _timer.Tick    += new EventHandler(Timer_Tick);
            _timer.Interval = new TimeSpan(0, 0, 0);
            _timer.Start();

            if (_isRunning.ToUpper() == "YES")
            {
                Mode             = AppResources.StartText;
                Start.Background = new SolidColorBrush(Colors.Green);
                StartTimer();
            }
            else
            {
                if (_adjustment == new TimeSpan(0, 0, 0))
                {
                    Mode             = AppResources.StartText;
                    Start.Background = new SolidColorBrush(Colors.Green);
                }
                else
                {
                    Mode             = AppResources.ResumeText;
                    Start.Background = new SolidColorBrush(Colors.Green);
                }
            }

            this.DataContext = this;
        }
Example #42
0
 public InstructionSetAttribute(IS iset)
 {
     this.Set = iset;
 }
 //ON Lock screen is disabled
 private void toggleswitch_Unchecked(object sender, RoutedEventArgs e)
 {
     PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
     IS.SaveSetting("Stopwatch-LockScreen", "Disabled");
     toggleswitch.Content = AppResources.Disabled;
 }
        /// <exception cref="System.IO.IOException"/>
        public virtual void TestServiceRpcBindHostKey()
        {
            Configuration  conf    = new HdfsConfiguration();
            MiniDFSCluster cluster = null;

            Log.Info("Testing without " + DfsNamenodeServiceRpcBindHostKey);
            conf.Set(DfsNamenodeServiceRpcAddressKey, LocalhostServerAddress);
            // NN should not bind the wildcard address by default.
            try
            {
                cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(0).Build();
                cluster.WaitActive();
                string address = GetServiceRpcServerAddress(cluster);
                Assert.AssertThat("Bind address not expected to be wildcard by default.", address
                                  , IsNot.Not("/" + WildcardAddress));
            }
            finally
            {
                if (cluster != null)
                {
                    cluster.Shutdown();
                    cluster = null;
                }
            }
            Log.Info("Testing with " + DfsNamenodeServiceRpcBindHostKey);
            // Tell NN to bind the wildcard address.
            conf.Set(DfsNamenodeServiceRpcBindHostKey, WildcardAddress);
            // Verify that NN binds wildcard address now.
            try
            {
                cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(0).Build();
                cluster.WaitActive();
                string address = GetServiceRpcServerAddress(cluster);
                Assert.AssertThat("Bind address " + address + " is not wildcard.", address, IS.Is
                                      ("/" + WildcardAddress));
            }
            finally
            {
                if (cluster != null)
                {
                    cluster.Shutdown();
                }
            }
        }
Example #45
0
 public IS(int head, IS tail)
 {
     IsEmpty = false;
     Head    = head;
     Tail    = tail;
 }
 public void Save(IS s)
 {
 }
 public DN(IWM vm, ISP sp)
 {
     this.vm = vm;
     this.sp = sp;
     CS      = new BS();
 }
Example #48
0
 private void chkGerman_Unchecked_1(object sender, RoutedEventArgs e)
 {
     App.gLanguages.Remove("German");
     IS.SaveSetting("BabyApp-German", "No");
 }
Example #49
0
 private void chkJapanese_Unchecked_1(object sender, RoutedEventArgs e)
 {
     App.gLanguages.Remove("Japanese");
     IS.SaveSetting("BabyApp-Japanese", "No");
 }
Example #50
0
        public virtual void TestSortLocatedBlocks()
        {
            // create the DatanodeManager which will be tested
            FSNamesystem fsn = Org.Mockito.Mockito.Mock <FSNamesystem>();

            Org.Mockito.Mockito.When(fsn.HasWriteLock()).ThenReturn(true);
            DatanodeManager dm = new DatanodeManager(Org.Mockito.Mockito.Mock <BlockManager>()
                                                     , fsn, new Configuration());

            // register 5 datanodes, each with different storage ID and type
            DatanodeInfo[] locs         = new DatanodeInfo[5];
            string[]       storageIDs   = new string[5];
            StorageType[]  storageTypes = new StorageType[] { StorageType.Archive, StorageType
                                                              .Default, StorageType.Disk, StorageType.RamDisk, StorageType.Ssd };
            for (int i = 0; i < 5; i++)
            {
                // register new datanode
                string uuid             = "UUID-" + i;
                string ip               = "IP-" + i;
                DatanodeRegistration dr = Org.Mockito.Mockito.Mock <DatanodeRegistration>();
                Org.Mockito.Mockito.When(dr.GetDatanodeUuid()).ThenReturn(uuid);
                Org.Mockito.Mockito.When(dr.GetIpAddr()).ThenReturn(ip);
                Org.Mockito.Mockito.When(dr.GetXferAddr()).ThenReturn(ip + ":9000");
                Org.Mockito.Mockito.When(dr.GetXferPort()).ThenReturn(9000);
                Org.Mockito.Mockito.When(dr.GetSoftwareVersion()).ThenReturn("version1");
                dm.RegisterDatanode(dr);
                // get location and storage information
                locs[i]       = dm.GetDatanode(uuid);
                storageIDs[i] = "storageID-" + i;
            }
            // set first 2 locations as decomissioned
            locs[0].SetDecommissioned();
            locs[1].SetDecommissioned();
            // create LocatedBlock with above locations
            ExtendedBlock        b      = new ExtendedBlock("somePoolID", 1234);
            LocatedBlock         block  = new LocatedBlock(b, locs, storageIDs, storageTypes);
            IList <LocatedBlock> blocks = new AList <LocatedBlock>();

            blocks.AddItem(block);
            string targetIp = locs[4].GetIpAddr();

            // sort block locations
            dm.SortLocatedBlocks(targetIp, blocks);
            // check that storage IDs/types are aligned with datanode locs
            DatanodeInfo[] sortedLocs = block.GetLocations();
            storageIDs   = block.GetStorageIDs();
            storageTypes = block.GetStorageTypes();
            Assert.AssertThat(sortedLocs.Length, IS.Is(5));
            Assert.AssertThat(storageIDs.Length, IS.Is(5));
            Assert.AssertThat(storageTypes.Length, IS.Is(5));
            for (int i_1 = 0; i_1 < sortedLocs.Length; i_1++)
            {
                Assert.AssertThat(((DatanodeInfoWithStorage)sortedLocs[i_1]).GetStorageID(), IS.Is
                                      (storageIDs[i_1]));
                Assert.AssertThat(((DatanodeInfoWithStorage)sortedLocs[i_1]).GetStorageType(), IS.Is
                                      (storageTypes[i_1]));
            }
            // Ensure the local node is first.
            Assert.AssertThat(sortedLocs[0].GetIpAddr(), IS.Is(targetIp));
            // Ensure the two decommissioned DNs were moved to the end.
            Assert.AssertThat(sortedLocs[sortedLocs.Length - 1].GetAdminState(), IS.Is(DatanodeInfo.AdminStates
                                                                                       .Decommissioned));
            Assert.AssertThat(sortedLocs[sortedLocs.Length - 2].GetAdminState(), IS.Is(DatanodeInfo.AdminStates
                                                                                       .Decommissioned));
        }
Example #51
0
 public OpCodeDescriptor(OpCode opcode, string name, string description, AT[][] validForms, bool incomplete, IS insSet, bool is32BitOnly, bool is64BitOnly)
 {
     this.OpCode              = opcode;
     this.Name                = name;
     this.Description         = string.Intern(description);
     this.ValidForms          = validForms;
     this.ValidArgumentCounts = validForms.Select(f => (byte)f.Length).Distinct().ToArray();
     this.Incomplete          = incomplete;
     this.InstructionSet      = insSet;
     this.Is32BitOnly         = is32BitOnly;
     this.Is64BitOnly         = is64BitOnly;
 }
        /*
         * Test conversion from a block file in a trash directory to its
         * target directory for restore.
         */
        public virtual void GetRestoreDirectoryForBlockFile(string fileName, int nestingLevel
                                                            )
        {
            BlockPoolSliceStorage storage = MakeBlockPoolStorage();
            string blockFileSubdir        = MakeRandomBlockFileSubdir(nestingLevel);
            string blockFileName          = fileName;
            string deletedFilePath        = storage.GetSingularStorageDir().GetRoot() + FilePath.separator
                                            + BlockPoolSliceStorage.TrashRootDir + blockFileSubdir + blockFileName;
            string expectedRestorePath = storage.GetSingularStorageDir().GetRoot() + FilePath
                                         .separator + Storage.StorageDirCurrent + Sharpen.Runtime.Substring(blockFileSubdir
                                                                                                            , 0, blockFileSubdir.Length - 1);

            Log.Info("Generated deleted file path " + deletedFilePath);
            Assert.AssertThat(storage.GetRestoreDirectory(new FilePath(deletedFilePath)), IS.Is
                                  (expectedRestorePath));
        }
    private IEnumerator Batalha()
    {
        //int manaMax = Jogador.Singleton.classeJogador.Mana;

        while (Jogador.Singleton.classeJogador.Vida >= 0 || inimigoAtual.Vida >= 0)
        {
            int turno = Turnos() + 1;

            bool proximoJogador = false;
            bool proximoInimigo = false;

            int velInimigo = inimigoAtual.GetVel;
            int velJogador = Jogador.Singleton.classeJogador.GetVel;

            if (Jogador.Singleton.classeJogador.Mana < Jogador.Singleton.classeJogador.GetManaMax)
            {
                Jogador.Singleton.classeJogador.Mana += Jogador.Singleton.classeJogador.GetInt;
            }

            IS infosInimigoIA = new IS(0, null);

            gerenciadorInterface.Interactable(true);

            if (velJogador > velInimigo)
            {
                gerenciadorInterface.infoPanel.text = "Sua Vez";
                if (gerenciadorInterface.infoBotaoAtual.valDois == null)
                {
                    yield return(null);
                }
                StartWait();
                gerenciadorInterface.infoPanel.text = gerenciadorInterface.infoBotaoAtual.valDois;
                proximoInimigo = true;
                proximoJogador = false;
            }
            else if (velJogador < velInimigo)
            {
                infosInimigoIA = inimigoAtual.InimigoIA();
                gerenciadorInterface.infoPanel.text = infosInimigoIA.valDois;
                proximoInimigo = false;
                proximoJogador = true;
            }

            StartWait();

            if (proximoInimigo == true && proximoJogador == false)
            {
                infosInimigoIA = inimigoAtual.InimigoIA();
                gerenciadorInterface.infoPanel.text = infosInimigoIA.valDois;
                infosInimigoIA = inimigoAtual.InimigoIA();
            }
            else if (proximoJogador == true && proximoInimigo == false)
            {
                gerenciadorInterface.infoPanel.text = "Sua Vez";
                if (gerenciadorInterface.infoBotaoAtual.valDois == null)
                {
                    yield return(null);
                }
                StartWait();
                gerenciadorInterface.infoPanel.text = gerenciadorInterface.infoBotaoAtual.valDois;
            }

            StartWait();

            string resultado = VerificadorAcao(infosInimigoIA.valUm);

            gerenciadorInterface.Status();

            gerenciadorInterface.infoPanel.text = resultado;

            StartWait();
        }

        Debug.Log("ACABOU - SUCESSO!!!!!!!!!!");
        yield return(null);
    }
Example #54
0
    public VR GetVR(string key)
    {
        //如果对象存在,则直接从享元池获取
        if (VRs.ContainsKey(key))
        {
            return((VR)VRs[key]);
        }
        //如果对象不存在,先创建一个新的对象添加到享元池中,然后返回
        else
        {
            VR fw = null;
            switch (key)
            {
            case "SS": fw = new SS(isBE, false); break;

            case "US": fw = new US(isBE); break;

            case "SL": fw = new SL(isBE, false); break;

            case "UL": fw = new UL(isBE, false); break;

            case "FL": fw = new FL(isBE, false); break;

            case "FD": fw = new FD(isBE, false); break;

            case "DA": fw = new DA(isBE, false); break;

            case "TM": fw = new TM(isBE, false); break;

            case "DT": fw = new DT(isBE, false); break;

            case "AS": fw = new AS(isBE, false); break;

            case "OB": fw = new OB(isBE); break;

            case "OF": fw = new OF(isBE, true); break;

            case "OW": fw = new OW(isBE); break;

            case "SQ": fw = new SQ(isBE, true); break;

            case "LO": fw = new LO(isBE, true); break;

            case "UI": fw = new UI(isBE, true); break;

            case "SH": fw = new SH(isBE, true); break;

            case "AE": fw = new AE(isBE, true); break;

            case "CS": fw = new CS(isBE, true); break;

            case "PN": fw = new PN(isBE, true); break;

            case "DS": fw = new DS(isBE); break;

            case "IS": fw = new IS(isBE, true); break;
                //default for text
                //default: fw = new ST(isBE, false); break;
            }
            VRs.Add(key, fw);
            return(fw);
        }
    }
Example #55
0
 protected override void Visit_IS(IS node)
 {
     /* MOVE CODE HERE */
 }
Example #56
0
        public virtual void TestAddVolumeFailures()
        {
            StartDFSCluster(1, 1);
            string         dataDir    = cluster.GetDataDirectory();
            DataNode       dn         = cluster.GetDataNodes()[0];
            IList <string> newDirs    = Lists.NewArrayList();
            int            NumNewDirs = 4;

            for (int i = 0; i < NumNewDirs; i++)
            {
                FilePath newVolume = new FilePath(dataDir, "new_vol" + i);
                newDirs.AddItem(newVolume.ToString());
                if (i % 2 == 0)
                {
                    // Make addVolume() fail.
                    newVolume.CreateNewFile();
                }
            }
            string newValue = dn.GetConf().Get(DFSConfigKeys.DfsDatanodeDataDirKey) + "," + Joiner
                              .On(",").Join(newDirs);

            try
            {
                dn.ReconfigurePropertyImpl(DFSConfigKeys.DfsDatanodeDataDirKey, newValue);
                NUnit.Framework.Assert.Fail("Expect to throw IOException.");
            }
            catch (ReconfigurationException e)
            {
                string   errorMessage = e.InnerException.Message;
                string[] messages     = errorMessage.Split("\\r?\\n");
                NUnit.Framework.Assert.AreEqual(2, messages.Length);
                Assert.AssertThat(messages[0], CoreMatchers.ContainsString("new_vol0"));
                Assert.AssertThat(messages[1], CoreMatchers.ContainsString("new_vol2"));
            }
            // Make sure that vol0 and vol2's metadata are not left in memory.
            FsDatasetSpi <object> dataset = dn.GetFSDataset();

            foreach (FsVolumeSpi volume in dataset.GetVolumes())
            {
                Assert.AssertThat(volume.GetBasePath(), IS.Is(CoreMatchers.Not(CoreMatchers.AnyOf
                                                                                   (IS.Is(newDirs[0]), IS.Is(newDirs[2])))));
            }
            DataStorage storage = dn.GetStorage();

            for (int i_1 = 0; i_1 < storage.GetNumStorageDirs(); i_1++)
            {
                Storage.StorageDirectory sd = storage.GetStorageDir(i_1);
                Assert.AssertThat(sd.GetRoot().ToString(), IS.Is(CoreMatchers.Not(CoreMatchers.AnyOf
                                                                                      (IS.Is(newDirs[0]), IS.Is(newDirs[2])))));
            }
            // The newly effective conf does not have vol0 and vol2.
            string[] effectiveVolumes = dn.GetConf().Get(DFSConfigKeys.DfsDatanodeDataDirKey)
                                        .Split(",");
            NUnit.Framework.Assert.AreEqual(4, effectiveVolumes.Length);
            foreach (string ev in effectiveVolumes)
            {
                Assert.AssertThat(StorageLocation.Parse(ev).GetFile().GetCanonicalPath(), IS.Is(CoreMatchers.Not
                                                                                                    (CoreMatchers.AnyOf(IS.Is(newDirs[0]), IS.Is(newDirs[2])))));
            }
        }
Example #57
0
        private void LoadLanguageSettings()
        {
            string settingValue = string.Empty;

            try
            {
                if (IS.GetSetting("BabyApp-English") == null)
                {
                    gLanguages.Remove("English");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-English").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("English");
                    }
                    else
                    {
                        gLanguages.Remove("English");
                    }
                }

                if (IS.GetSetting("BabyApp-Spanish") == null)
                {
                    gLanguages.Remove("Spanish");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-Spanish").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("Spanish");
                    }
                    else
                    {
                        gLanguages.Remove("Spanish");
                    }
                }

                if (IS.GetSetting("BabyApp-Italian") == null)
                {
                    gLanguages.Remove("Italian");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-Italian").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("Italian");
                    }
                    else
                    {
                        gLanguages.Remove("Italian");
                    }
                }

                if (IS.GetSetting("BabyApp-French") == null)
                {
                    gLanguages.Remove("French");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-French").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("French");
                    }
                    else
                    {
                        gLanguages.Remove("French");
                    }
                }

                if (IS.GetSetting("BabyApp-Polish") == null)
                {
                    gLanguages.Remove("Polish");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-Polish").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("Polish");
                    }
                    else
                    {
                        gLanguages.Remove("Polish");
                    }
                }

                if (IS.GetSetting("BabyApp-German") == null)
                {
                    gLanguages.Remove("German");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-German").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("German");
                    }
                    else
                    {
                        gLanguages.Remove("German");
                    }
                }

                if (IS.GetSetting("BabyApp-Portuguese") == null)
                {
                    gLanguages.Remove("Portuguese");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-Portuguese").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("Portuguese");
                    }
                    else
                    {
                        gLanguages.Remove("Portuguese");
                    }
                }

                if (IS.GetSetting("BabyApp-Japanese") == null)
                {
                    gLanguages.Remove("Japanese");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-Japanese").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("Japanese");
                    }
                    else
                    {
                        gLanguages.Remove("Japanese");
                    }
                }

                if (IS.GetSetting("BabyApp-Chinese") == null)
                {
                    gLanguages.Remove("Chinese");
                }
                else
                {
                    settingValue = IS.GetSetting("BabyApp-Chinese").ToString();
                    if (settingValue == "Yes")
                    {
                        gLanguages.Add("Chinese");
                    }
                    else
                    {
                        gLanguages.Remove("Chinese");
                    }
                }

                if (gLanguages.Count == 0)
                {
                    gLanguages.Add("English");
                    IS.SaveSetting("BabyApp-English", "Yes");
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #58
0
 protected virtual void Visit_IS(IS node)
 {
 }
Example #59
0
 private void chkEnglish_Unchecked_1(object sender, RoutedEventArgs e)
 {
     App.gLanguages.Remove("English");
     IS.SaveSetting("BabyApp-English", "No");
 }
Example #60
0
        private async void WriteUserInfoToCloud(bool trial)
        {
            try
            {
                bool isAppPaid = false;

                if (App.FREE_VERSION)
                {
                    if (App.DoesUserHaveAbilityToTrackAllStats())
                    {
                        isAppPaid = true;
                    }
                }
                else
                {
                    if (!App.IsTrial)
                    {
                        isAppPaid = true;
                    }
                }

                if (IS.GetSetting(USER_ID) == null)
                {
                    string newGuid = Guid.NewGuid().ToString();

                    AllUsers rowToInsert = new AllUsers()
                    {
                        Guid           = newGuid,
                        TimesOpened    = 1,
                        FreeVersion    = App.FREE_VERSION,
                        TrialVersion   = App.IsTrial,
                        TotalTimeInApp = new TimeSpan(0, 0, 0),
                        Paid           = isAppPaid,
                        LastLogin      = DateTime.Now
                    };

                    await App.MobileService.GetTable <AllUsers>().InsertAsync(rowToInsert);

                    var newUserRow = await allUsersTable
                                     .Where(x => x.Guid == newGuid).ToListAsync();

                    _clientRow = newUserRow.FirstOrDefault();

                    //Update IS
                    IS.SaveSetting(USER_ID, _clientRow.Id);

                    //Remove the GUID, we no longer need it
                    rowToInsert.Guid = string.Empty;
                    await App.MobileService.GetTable <AllUsers>().UpdateAsync(rowToInsert);
                }
                //Update
                else
                {
                    var rows = await allUsersTable
                               .Where(x => x.Id == IS.GetSettingStringValue(USER_ID)).ToListAsync();

                    AllUsers userRow = rows.ToList().FirstOrDefault();
                    userRow.LastLogin    = DateTime.Now;
                    userRow.TimesOpened += 1;
                    userRow.FreeVersion  = App.FREE_VERSION;
                    userRow.TrialVersion = App.IsTrial;
                    userRow.Paid         = isAppPaid;

                    _clientRow = userRow;

                    await App.MobileService.GetTable <AllUsers>().UpdateAsync(userRow);
                }
            }
            catch (Exception ex)
            {
            }
        }