private async void CompilerServices_BuildComplete(object sender, bool success) { _compilerServices.BuildComplete -= CompilerServices_BuildComplete; await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(Package.DisposalToken); if (!success) { Package.OutputWindowWriteLine("The build failed. Fix and retry."); } var localSystem = new LocalSystem(); //Create mdb files from pdb files. (Mono requires mdb files) string localPath = _compilerServices.GetOutputFolder(Package); List <FileListingItem> localFileListing = localSystem.GetFileListing(Package, localPath); _compilerServices.CreateMdbFiles(Package, localPath, localFileListing); //Get a list of files (name, date, size) from the control system List <FileListingItem> remoteFileListing = _controlSystem.GetFileListing(Package, Settings.RelativePath); //Determine what files need to be removed from the control system List <FileDeltaItem> delta = localSystem.CreateFileListingDelta(Package, remoteFileListing, localPath); //Sync control system with local system _controlSystem.Sync(Package, localPath, delta); //Start program on control system _controlSystem.StartProgram(Package); Package.OutputWindowWriteLine("Finished."); }
public static bool IsLocal(string host) { if (string.IsNullOrEmpty(host)) { return(true); } string lowerHost = host.ToLowerInvariant(); return(lowerHost == "localhost" || lowerHost == LocalSystem.ToLowerInvariant() || host == "127.0.0.1" || host == "::1"); }
public void ConvertToVerified() { var ls = new LocalSystem { IsOwnerInnerObject = true }; var dls = ls.AsDynamic; using (ls.BeginConstruct()) { var vp = ls.GetOrConvertVerifiedProperty("Foobar"); Assert.IsInstanceOfType(vp, typeof(VerifiedProperty)); vp.Value = 100; Assert.IsTrue(dls.Foobar == 100); } }
public LoginViewModel() { user = new User { UserName = "", DisplayName = LocalSystem.GetLastLoggedOn(), Password = string.Empty }; ProfileImage = new BitmapImage(UserSettings.GetProfileImagePath()); BackgroundImage = new BitmapImage(new Uri(@Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Microsoft\\Windows\\Themes\\TranscodedWallpaper"))); }
public void ValidatePropertyTest() { var ls = new LocalSystem { IsOwnerInnerObject = true }; var dls = ls.AsDynamic; var lstReasonFailure = new List<string>(); VerifiedProperty vp; using (ls.BeginConstruct()) vp = ls.GetOrConvertVerifiedProperty("Foobar"); dls.Foobar = 20; // Создаем валидаторы с описанием vp.ValidateHnd += VerifiedProperty.CreateValidator<int>((prop, value) => value <= 100, ">100"); vp.ValidateHnd += VerifiedProperty.CreateValidator<int>((prop, value) => value <= 50, ">50"); Assert.IsFalse(ls.VerifySetPropertyValue("Foobar", 101, lstReasonFailure)); Assert.AreEqual(lstReasonFailure.Count, 2); Assert.IsTrue(lstReasonFailure.Contains(">100")); Assert.IsTrue(lstReasonFailure.Contains(">50")); lstReasonFailure.Clear(); Assert.IsFalse(ls.VerifySetPropertyValue("Foobar", 70, lstReasonFailure)); Assert.IsTrue(lstReasonFailure.Contains(">50")); }
public void ConvertToVerifiedFailed() { var ls = new LocalSystem { IsOwnerInnerObject = true }; ls.GetOrConvertVerifiedProperty("Foobar"); }
public void DistanceInLocalSystems() { var starSys = new LocalSystem { Level = 5, Resolution = 1000 }; var groupA = new LocalSystem { Level = 8, Resolution = 10 }; var groupB = new LocalSystem { Level = 8, Resolution = 10 }; StarShip ssA = new StarShip(), ssB = new StarShip(); starSys .PlaceAt(groupA, 0, 0) .PlaceAt(groupB, 3, 4); groupA.PlaceAt(ssA, 0, 0); groupB.PlaceAt(ssB, 0, 0); var m = new Mechanics(); var d = m.DistanceFor(ssA, ssB); Assert.IsTrue(d == 5000); }
public void ShiftInLocalSystem() { var ls = new LocalSystem(); var ss = new StarShip(); ls.Place(ss, new PointF(1, 2)); ls.Shift(ss, new PointF(10, 100)); var crd = ls.Resolve(ss); Assert.AreEqual(crd, new PointF(11, 102)); ls.Shift(ss, new PointF(1, -10)); crd = ls.Resolve(ss); Assert.AreEqual(crd, new PointF(12, 92)); }
public void PlaceinLocalSystem() { var ls = new LocalSystem(); var ss = new StarShip(); ls.Place(ss, new PointF(1, 2)); var crd = ls.Resolve(ss); Assert.AreEqual(crd, new PointF(1, 2)); ls.Remove(ss); Assert.IsFalse(ls.Contains(ss)); ls.Place(ss, new PointF(6, 8)); crd = ls.Resolve(ss); Assert.AreEqual(crd, new PointF(6, 8)); }
public void CalculatePropertyTest() { var ls = new LocalSystem { IsOwnerInnerObject = true }; var dls = ls.AsDynamic; VerifiedProperty vp; using (ls.BeginConstruct()) vp = ls.GetOrConvertVerifiedProperty("Foobar"); var a = 100; vp.IsCalculated = true; vp.CalculateHnd += prop => a; Assert.AreEqual(dls.Foobar, 100); a = 200; Assert.AreEqual(dls.Foobar, 200); }