/// <summary> /// Default constructor. /// </summary> public Area() { ++_count; _recall = -1; for (int i = 0; i < Limits.NUM_AREA_FLAGS; i++) { _areaFlags[i] = 0; } _security = 1; _ageInSeconds = 0; _numPlayers = 0; _version = 0; _height = 0; _width = 0; _defenderTemplateNumber = 0; _defendersPerSquad = 0; _barracksRoom = 0; _judgeRoom = 0; _jailRoom = 0; _defenderSquads = 0; _defendersDispatched = 0; _justiceType = 0; _minRecommendedLevel = 1; _maxRecommendedLevel = 40; _timesReset = 0; _resetMode = ResetMode.normal; _minutesBetweenResets = 15; _guildId = 0; _name = "New Area"; _builders = "None"; _author = "None"; _resetMessage = "You hear some noises in the distance."; _filename = "area" + _count + ".are.xml"; }
public override int GetHashCode() { int hash = 1; if (Id.Length != 0) { hash ^= Id.GetHashCode(); } if (startReqs_ != null) { hash ^= StartReqs.GetHashCode(); } if (StepFlagGmtId.Length != 0) { hash ^= StepFlagGmtId.GetHashCode(); } if (CompleteFlagGmtId.Length != 0) { hash ^= CompleteFlagGmtId.GetHashCode(); } hash ^= storyboardSteps_.GetHashCode(); if (ResetMode != 0) { hash ^= ResetMode.GetHashCode(); } if (resetReqs_ != null) { hash ^= ResetReqs.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override void OnGUI(Rect rect) { EditorGUILayout.Space(); resetMode = (ResetMode)EditorGUILayout.EnumPopup(GitGUI.GetTempContent("Reset Type"), resetMode); switch (resetMode) { case ResetMode.Soft: EditorGUILayout.HelpBox("Leave working tree and index untouched", MessageType.Info); break; case ResetMode.Mixed: EditorGUILayout.HelpBox("Leave working tree untouched,reset index (Default)", MessageType.Info); break; case ResetMode.Hard: EditorGUILayout.HelpBox("Reset working tree and index (Will delete all files)", MessageType.Error); break; } GUILayout.FlexibleSpace(); if (GUILayout.Button("Reset")) { if (EditorUtility.DisplayDialog("Reset", "Are you sure you want to reset to the selected commit", "Reset", "Cancel")) { GitProfilerProxy.BeginSample("Git Reset Popup", editorWindow); GitManager.Repository.Reset(resetMode, commit, checkoutOptions); GitManager.MarkDirty(true); editorWindow.Close(); GitProfilerProxy.EndSample(); AssetDatabase.Refresh(); } } EditorGUILayout.Space(); }
public void Reset(ResetMode mode = ResetMode.Software) { switch (mode) { case ResetMode.Software: var modemStatusFilter = new PacketTypeFilter(typeof(ModemStatusResponse)); var response = Send(AtCmd.SoftwareReset).Use(modemStatusFilter).GetResponse(); var modemStatus = ((ModemStatusResponse)response).Status; if (modemStatus != ModemStatus.WatchdogTimerReset) { throw new XBeeException("Unexpected modem status: " + modemStatus); } break; case ResetMode.RestoreDefaults: Send(AtCmd.RestoreDefaults).GetResponse(); break; case ResetMode.Network: if (Config.IsSeries1()) { throw new NotSupportedException("Series 1 has no network reset command"); } Send(AtCmd.NetworkReset).GetResponse(); break; } }
/// <summary> /// Adds the git argument syntax for members of the <see cref="ResetMode"/> enum. /// </summary> /// <param name="builder">The <see cref="ArgumentBuilder"/> to add arguments to.</param> /// <param name="mode">The enum member to add to the builder.</param> public static void Add(this ArgumentBuilder builder, ResetMode mode) { builder.Add(GetArgument()); string GetArgument() { switch (mode) { case ResetMode.ResetIndex: return(""); case ResetMode.Soft: return("--soft"); case ResetMode.Mixed: return("--mixed"); case ResetMode.Hard: return("--hard"); default: throw new InvalidEnumArgumentException(nameof(mode), (int)mode, typeof(ResetMode)); } } }
/// <summary>Reset HEAD to <paramref name="revision"/>.</summary> /// <param name="mode">Reset mode</param> /// <param name="revision">HEAD's new position.</param> /// <exception cref="T:System.ArgumentNullException"> /// <paramref name="revision"/> == null. /// </exception> /// <exception cref="T:System.ArgumentException"> /// <paramref name="revision"/> is not handled by this <see cref="Repository"/> or it is deleted. /// </exception> /// <exception cref="T:gitter.Git.GitException"> /// Failed to dereference <paramref name="revision"/> or git reset failed. /// </exception> public static void ResetHeadHere(this IRevisionPointer revision, ResetMode mode = ResetMode.Mixed) { Verify.Argument.IsValidRevisionPointer(revision, "revision"); var repository = revision.Repository; repository.Head.Reset(revision, mode); }
/// <summary> /// Sets the current <see cref="Repository.Head"/> to the specified commit and optionally resets the <see cref="Index"/> and /// the content of the working tree to match. /// </summary> /// <param name="repository">The <see cref="Repository"/> being worked with.</param> /// <param name="resetMode">Flavor of reset operation to perform.</param> /// <param name="committish">A revparse spec for the target commit object.</param> public static void Reset(this IRepository repository, ResetMode resetMode, string committish = "HEAD") { Ensure.ArgumentNotNullOrEmptyString(committish, "committish"); Commit commit = LookUpCommit(repository, committish); repository.Reset(resetMode, commit); }
/// <summary> /// Sets the current <see cref="Head"/> to the specified commit and optionally resets the <see cref="Index"/> and /// the content of the working tree to match. /// </summary> /// <param name="resetMode">Flavor of reset operation to perform.</param> /// <param name="commit">The target commit object.</param> public void Reset(ResetMode resetMode, Commit commit) { Ensure.ArgumentNotNull(commit, "commit"); Proxy.git_reset(handle, commit.Id, resetMode); Refs.Log(Refs.Head).Append(commit.Id, string.Format("reset: moving to {0}", commit.Sha)); }
public override void DisplayEditorView() { base.DisplayEditorView(); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("EaseTime", GUILayout.Width(100)); EaseTime = EditorGUILayout.FloatField(EaseTime); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("EaseType", GUILayout.Width(100)); EaseType = (iTween.EaseType)EditorGUILayout.EnumPopup(EaseType); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("ResetMode", GUILayout.Width(100)); HowToReset = (ResetMode)EditorGUILayout.EnumPopup(HowToReset); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Reset", GUILayout.Width(100)); Reset = EditorGUILayout.Toggle(Reset); GUILayout.EndHorizontal(); //GUILayout.BeginHorizontal(); //EditorGUILayout.LabelField("ObjStatusOperation", GUILayout.Width(100)); //ObjStatusOperation = (GameObjectStatusOperation)EditorGUILayout.EnumPopup(ObjStatusOperation); //GUILayout.EndHorizontal(); //GUILayout.BeginHorizontal(); //EditorGUILayout.LabelField("AnimateType", GUILayout.Width(100)); //AnimateType = (EaseActionType)EditorGUILayout.EnumPopup(AnimateType); //GUILayout.EndHorizontal(); GUILayout.Space(3.0f); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("OverrideObject", GUILayout.Width(100)); OverrideObject = (GameObject)EditorGUILayout.ObjectField(OverrideObject, typeof(GameObject), true); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Target", GUILayout.Width(100)); Target = (Transform)EditorGUILayout.ObjectField(Target, typeof(Transform), true); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Vec3Target", GUILayout.Width(100)); Vec3Target = EditorGUILayout.Vector3Field("", Vec3Target); GUILayout.EndHorizontal(); //GUILayout.BeginHorizontal(); //EditorGUILayout.LabelField("Calculator", GUILayout.Width(100)); //Calculator = (DynamicCalculator)EditorGUILayout.ObjectField(Calculator, typeof(DynamicCalculator), true); //GUILayout.EndHorizontal(); // EditorGUILayout.HelpBox("It will be set to target while Target(Transform) is null", MessageType.Info); }
/// <summary> /// Reset the player. /// </summary> /// <param name="resetMode">Reset mode</param> public void Reset(ResetMode resetMode) { if (resetMode == ResetMode.Death) { _playerModel.Lives--; } _playerModel.ResetPosition(resetMode); }
protected override void OnTweenReset(bool kill, ResetMode resetMode) { for (int i = tweens.Count - 1; i >= 0; --i) { Tween tween = tweens[i]; tween.Reset(kill, resetMode); } }
protected override void OnTweenReset(bool kill, ResetMode resetMode) { for (int i = tweeners.Count - 1; i >= 0; --i) { ITweener tweener = tweeners[i]; tweener.Reset(resetMode); } }
/// <summary> /// Sets the current <see cref="Repository.Head"/> to the specified commit and optionally resets the <see cref="Index"/> and /// the content of the working tree to match. /// </summary> /// <param name="repository">The <see cref="Repository"/> being worked with.</param> /// <param name="resetMode">Flavor of reset operation to perform.</param> /// <param name="committish">A revparse spec for the target commit object.</param> /// <param name="signature">Identification for use when updating the reflog</param> /// <param name="logMessage">Message to append to the reflog</param> public static void Reset(this IRepository repository, ResetMode resetMode, string committish = "HEAD", Signature signature = null, string logMessage = null) { Ensure.ArgumentNotNullOrEmptyString(committish, "committish"); Commit commit = LookUpCommit(repository, committish); repository.Reset(resetMode, commit, signature, logMessage); }
private IObservable <Unit> ResetImpl(IGitIdObject gitIdObject, ResetMode resetMode) { var canCompleteObservable = CommonInteractions.CheckToProceed.Handle( $"Do you really want to reset {gitIdObject.ShaShort} using {resetMode} reset?"); return(canCompleteObservable.CompleteIfTrue( RepositoryDetails.GitObjectManager.Reset(gitIdObject, resetMode))); }
/// <inheritdoc /> public IObservable <Unit> Reset(IGitIdObject gitObject, ResetMode resetMode, IScheduler scheduler = null) { if (gitObject == null) { throw new ArgumentNullException(nameof(gitObject)); } var arguments = new[] { "reset", $"--{resetMode.ToString().ToLowerInvariant()}", gitObject.Sha }; return(_gitProcessManager.RunGit(arguments, showInOutput: true, scheduler: scheduler).WhenDone()); }
private CommandLink CreateResetButton(ResetMode mode) { string text = string.Empty; string desc = string.Empty; switch (mode) { case ResetMode.Soft: text = Resources.StrSoft; desc = Resources.TipSoftReset; break; case ResetMode.Mixed: text = Resources.StrMixed; desc = Resources.TipMixedReset; break; case ResetMode.Hard: text = Resources.StrHard; desc = Resources.TipHardReset; break; case ResetMode.Merge: text = Resources.StrMerge; desc = Resources.TipMergeReset; break; case ResetMode.Keep: text = Resources.StrKeep; desc = Resources.TipKeepReset; break; default: throw new NotSupportedException(); } var btn = new CommandLink() { Size = new Size(319, 66), Text = text, Description = desc, Tag = mode, }; btn.Click += (s, e) => { ResetMode = (ResetMode)((Control)s).Tag; ClickOk(); }; return(btn); }
public void Reset(bool kill, ResetMode resetMode = ResetMode.InitialValues) { if (kill) { Kill(); IsPlaying = false; } IsCompleted = false; OnTweenReset(kill, resetMode); OnReset?.Invoke(); }
/// <summary> /// The Git command line for reset /// </summary> /// <param name="mode">Reset mode</param> /// <param name="commit">Optional commit-ish (for reset-index this is tree-ish and mandatory)</param> /// <param name="file">Optional file to reset</param> /// <returns>Argument string</returns> public static ArgumentString ResetCmd(ResetMode mode, string commit = null, string file = null) { if (mode == ResetMode.ResetIndex && string.IsNullOrWhiteSpace(commit)) { throw new ArgumentException("reset to index requires a tree-ish parameter"); } return(new GitArgumentBuilder("reset") { mode, commit.QuoteNE(), "--", file?.ToPosixPath().QuoteNE() }); }
internal void ResetPosition(ResetMode resetMode) { Position = StartPosition; if (resetMode == ResetMode.Death) { HPLeft = HP; Invulnerable = true; } if (resetMode == ResetMode.Level) { AddXp(20); } }
/// <summary> /// Resets the device and clears sensors readings. /// </summary> public virtual void Reset(ResetMode mode = ResetMode.SoftwareReset) { // Create message var message = new ResetReceiver(); message.ResetMode = mode; // Write message to receiver WriteMessage(message); // Clear result GeodeticSensorReading = GeodeticSensorReading.Zero; // Wait for reset completion Task.Delay(ResetDelay).Wait(); }
private void AskAndReset(ResetMode mode) { if (mode == ResetMode.Hard) { if (GitterApplication.MessageBoxService.Show( this, Resources.StrAskHardReset, Resources.StrHardReset, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; } } Reset(mode); }
/// <summary>Reset changes in working tree.</summary> /// <param name="mode">Reset mode</param> /// <exception cref="T:gitter.Git.GitException">git reset failed.</exception> public void Reset(ResetMode mode) { try { using (Repository.Monitor.BlockNotifications( RepositoryNotifications.IndexUpdated, RepositoryNotifications.WorktreeUpdated)) { Repository.Accessor.Reset.Invoke( new ResetParameters(mode)); } } finally { Refresh(); } }
private void ParseCommandLine() { if (_UpdateInProgress > 0) { return; } _UpdateInProgress++; try { var cmdLine = new RedLinkServerCommandLine(CommandLine); //Update devices var devices = _Database.AllDevices.Select(d => new KnownDeviceEntry(d)).ToList(); string mcuVendor = _Host.MCU.ExpandedMCU.AdditionalSystemVars?.FirstOrDefault(v => v.Key == "REDLINK:VENDOR_ID")?.Value; string mcuDev = _Host.MCU.ExpandedMCU.AdditionalSystemVars?.FirstOrDefault(v => v.Key == "REDLINK:DEVICE_ID")?.Value; var resolvedDevice = devices.FirstOrDefault(d => d.Device.MatchesDefinition(mcuVendor, mcuDev))?.Device; devices.Insert(0, new KnownDeviceEntry(mcuDev, resolvedDevice)); string cmdlineVendor = cmdLine.Vendor ?? RedLinkServerCommandLine.DefaultVendor; string cmdlineDev = cmdLine.Device ?? RedLinkServerCommandLine.DefaultDevice; var selectedDevice = devices.FirstOrDefault(d => d.Device.MatchesDefinition(cmdlineVendor, cmdlineDev)); if (selectedDevice == null) { selectedDevice = new KnownDeviceEntry(new RedLinkDeviceDatabase.KnownDevice(new RedLinkDeviceDatabase.Key(cmdlineVendor, cmdlineDev), null, false)); devices.Add(selectedDevice); } Devices = devices.ToArray(); Device = selectedDevice; //Update cores ResetMode.Load(cmdLine); Interface.Load(cmdLine); Core.Load(cmdLine); } finally { _UpdateInProgress--; } }
// Resets isInMoveRange, isInSpellRange and isInPath // soft = Do not reset isInMoveRange and isInSpellRange // hard = Also reset Selected public static void ResetGrid(ResetMode mode = ResetMode.normal) { // if "soft", reset only isInPath // if "hard", reset selected too foreach (CellScript cell in grid) { cell.isInPath = false; if (mode != ResetMode.soft) { cell.isInMoveRange = false; cell.isInSpellRange = false; } else if (mode == ResetMode.hard) { cell.selected = false; } } }
public static ICommandArgument Mode(ResetMode mode) { switch(mode) { case ResetMode.Mixed: return ResetCommand.Mixed(); case ResetMode.Soft: return ResetCommand.Soft(); case ResetMode.Hard: return ResetCommand.Hard(); case ResetMode.Merge: return ResetCommand.Merge(); case ResetMode.Keep: return ResetCommand.Keep(); default: throw new ArgumentException("Unknown ResetMode", "mode"); } }
private bool NewLoop(ResetMode loopResetMode) { bool needsToLoop = loopsRemaining > 0; if (!needsToLoop || !Loopable) { return(false); } --loopsRemaining; Reset(kill: false, loopResetMode); Start(); OnLoop?.Invoke(); return(true); }
private void Reset(ResetMode mode) { try { using (_commitView.ChangeCursor(Cursors.WaitCursor)) { _commitView.Repository.Status.Reset(mode); } } catch (GitException exc) { GitterApplication.MessageBoxService.Show( this, exc.Message, Resources.ErrFailedToReset, MessageBoxButton.Close, MessageBoxIcon.Error); } }
/// <summary> /// Performs a special reset on this DataModel object /// and resets the OriginalData, IsDirty, MarkDeleted, /// and IsNew properties. /// </summary> /// <seealso cref="ResetMode"/> /// <param name="resetMode"></param> public void Reset(ResetMode resetMode) { if (resetMode != ResetMode.RetainNotDirty) { if (resetMode == ResetMode.RevertNotDirty) { InnerData = OriginalData; SynchronizeFields(SyncTo.ClrMembers); } else if (resetMode == ResetMode.ClearAndNew) { Initialize(Entity); } } _IsDirty = false; MarkDeleted = false; _IsNew = _IsNew || resetMode == ResetMode.ClearAndNew; OriginalData = new CaseInsensitiveDictionary <object>(InnerData); // hrm I don't remember why this is being done?? }
/// <summary> /// Reset the player. /// </summary> /// <param name="resetMode">Reset mode</param> /// <param name="resetForce">Reset force before dying</param> public void Reset(ResetMode resetMode, bool resetForce = false) { if (resetMode == ResetMode.Death && !_inDeathAnimation) { _model.Lives--; _inDeathAnimation = true; _model.Flip = SpriteEffects.None; if (resetForce) { _force = 0f; } _animation = new FrogAnimation(new int[] { 19, 20, 21, 22 }, _model.Position, new Vector2(0, 0), DeathCooldownPeriod); } else if (resetMode == ResetMode.Goal) { _animation = null; _model.Frame = 34; _force = 0f; _model.Flip = SpriteEffects.None; _model.Position = new Vector2((16 * 7), 224); _model.Score += 50; _model.Goals++; if (_model.Score > _model.HiScore) { _model.HiScore = _model.Score; } if (_model.Goals == 5) { _model.Score += 1000; } _cooldown = new Cooldown(0.5f); _inDeathAnimation = false; } }
/// <summary>Reset HEAD to <paramref name="pointer"/>.</summary> /// <param name="mode">Reset mode</param> /// <param name="pointer">HEAD's new position.</param> /// <exception cref="T:System.ArgumentNullException"><paramref name="pointer"/> == <c>null</c>.</exception> /// <exception cref="T:System.ArgumentException"> /// <paramref name="pointer"/> is not handled by this <see cref="Repository"/> or it is deleted. /// </exception> /// <exception cref="T:gitter.Git.GitException"> /// Failed to dereference <paramref name="pointer"/> or git reset failed. /// </exception> public void Reset(IRevisionPointer pointer, ResetMode mode) { Verify.Argument.IsValidRevisionPointer(pointer, Repository, nameof(pointer)); var pos = Pointer.Dereference(); var rev = pointer.Dereference(); var currentBranch = Pointer as Branch; using (Repository.Monitor.BlockNotifications( RepositoryNotifications.BranchChanged, RepositoryNotifications.Checkout, RepositoryNotifications.IndexUpdated, RepositoryNotifications.WorktreeUpdated, RepositoryNotifications.SubmodulesChanged)) { Repository.Accessor.Reset.Invoke( new ResetParameters(rev.Hash.ToString(), mode)); } if (currentBranch != null) { currentBranch.Pointer = rev; } else { Pointer = rev; } if (pos != rev) { NotifyRelogRecordAdded(); } Repository.Status.Refresh(); Repository.Submodules.Refresh(); Repository.OnStateChanged(); }
public static ICommandArgument Mode(ResetMode mode) { switch (mode) { case ResetMode.Mixed: return(ResetCommand.Mixed()); case ResetMode.Soft: return(ResetCommand.Soft()); case ResetMode.Hard: return(ResetCommand.Hard()); case ResetMode.Merge: return(ResetCommand.Merge()); case ResetMode.Keep: return(ResetCommand.Keep()); default: throw new ArgumentException("Unknown ResetMode", nameof(mode)); } }
public SelectResetModeDialog(ResetMode availableModes) { InitializeComponent(); Text = Resources.StrReset; _availableModes = availableModes; _resetMode = ResetMode.Mixed; _buttons = new List<CommandLink>(ResetModes.Length); foreach(var resetMode in ResetModes) { if((_availableModes & resetMode) == resetMode) { _buttons.Add(CreateResetButton(resetMode)); } } const int margin = 16; SuspendLayout(); var location = new Point(margin, margin); var h = margin; foreach(var button in _buttons) { button.Location = location; button.Parent = this; h += button.Height + margin; location.Y += button.Height + margin; } Height = h; AutoScaleDimensions = new SizeF(96F, 96F); ResumeLayout(false); PerformLayout(); }
public void Reset(ResetMode resetMode, Commit commit) { throw new NotImplementedException(); }
private CommandLink CreateResetButton(ResetMode mode) { string text = string.Empty; string desc = string.Empty; switch(mode) { case ResetMode.Soft: text = Resources.StrSoft; desc = Resources.TipSoftReset; break; case ResetMode.Mixed: text = Resources.StrMixed; desc = Resources.TipMixedReset; break; case ResetMode.Hard: text = Resources.StrHard; desc = Resources.TipHardReset; break; case ResetMode.Merge: text = Resources.StrMerge; desc = Resources.TipMergeReset; break; case ResetMode.Keep: text = Resources.StrKeep; desc = Resources.TipKeepReset; break; default: throw new NotSupportedException(); } var btn = new CommandLink() { Size = new Size(319, 66), Text = text, Description = desc, Tag = mode, }; btn.Click += (s, e) => { ResetMode = (ResetMode)((Control)s).Tag; ClickOk(); }; return btn; }
/// <summary>Create <see cref="ResetParameters"/>.</summary> /// <param name="mode">Reset mode.</param> public ResetParameters(ResetMode mode) { Mode = mode; }
public void Reset(ResetMode mode, string commitSha) => _model.Reset(mode, commitSha);
/// <summary>Create <see cref="ResetParameters"/>.</summary> /// <param name="revision">Revision to reset to.</param> /// <param name="mode">Reset mode.</param> public ResetParameters(string revision, ResetMode mode) { Revision = revision; Mode = mode; }
public void Reset(ResetMode resetMode, Commit commit, Signature signature = null, string logMessage = null) { throw new NotImplementedException(); }
public void Reset(ResetMode mode, string commitSha) { _jobQueue.AddJob( $"Reset: {mode} {commitSha}", () => { var commit = FindCommitBySha(commitSha); Internal.Reset(mode, commit); }); }
protected override void Reset(ResetMode mode) { base.Reset(mode); if (mode == ResetMode.Reinitialize) { InitializeNewAlgoRun(AlgoInitializationMode.Startup); ResetBackwardValues(); } }
public void Reset(ResetMode resetMode, Commit commit, CheckoutOptions options) { throw new NotImplementedException(); }
/// <summary>Reset HEAD to <paramref name="pointer"/>.</summary> /// <param name="mode">Reset mode</param> /// <param name="pointer">HEAD's new position.</param> /// <exception cref="T:System.ArgumentNullException"><paramref name="pointer"/> == <c>null</c>.</exception> /// <exception cref="T:System.ArgumentException"> /// <paramref name="pointer"/> is not handled by this <see cref="Repository"/> or it is deleted. /// </exception> /// <exception cref="T:gitter.Git.GitException"> /// Failed to dereference <paramref name="pointer"/> or git reset failed. /// </exception> public void Reset(IRevisionPointer pointer, ResetMode mode) { Verify.Argument.IsValidRevisionPointer(pointer, Repository, "pointer"); var pos = Pointer.Dereference(); var rev = pointer.Dereference(); var currentBranch = Pointer as Branch; using(Repository.Monitor.BlockNotifications( RepositoryNotifications.BranchChanged, RepositoryNotifications.Checkout, RepositoryNotifications.IndexUpdated, RepositoryNotifications.WorktreeUpdated, RepositoryNotifications.SubmodulesChanged)) { Repository.Accessor.Reset.Invoke( new ResetParameters(rev.Hash.ToString(), mode)); } if(currentBranch != null) { currentBranch.Pointer = rev; } else { Pointer = rev; } if(pos != rev) { NotifyRelogRecordAdded(); } Repository.Status.Refresh(); Repository.Submodules.Refresh(); Repository.OnStateChanged(); }
/// <summary>Reset changes in working tree.</summary> /// <param name="mode">Reset mode</param> /// <exception cref="T:gitter.Git.GitException">git reset failed.</exception> public void Reset(ResetMode mode) { try { using(Repository.Monitor.BlockNotifications( RepositoryNotifications.IndexUpdated, RepositoryNotifications.WorktreeUpdated)) { Repository.Accessor.Reset.Invoke( new ResetParameters(mode)); } } finally { Refresh(); } }
public void Reset(ResetMode mode = ResetMode.Software) { switch (mode) { case ResetMode.Software: var modemStatusFilter = new PacketTypeFilter(typeof(ModemStatusResponse)); var response = Send(AtCmd.SoftwareReset).Use(modemStatusFilter).GetResponse(); var modemStatus = ((ModemStatusResponse) response).Status; if (modemStatus != ModemStatus.WatchdogTimerReset) throw new XBeeException("Unexpected modem status: " + modemStatus); break; case ResetMode.RestoreDefaults: Send(AtCmd.RestoreDefaults).GetResponse(); break; case ResetMode.Network: if (Config.IsSeries1()) throw new NotSupportedException("Series 1 has no network reset command"); Send(AtCmd.NetworkReset).GetResponse(); break; } }