public DataSource(TwainDevice twain, TwIdentity identity) { fTwain = twain; fIdent = identity; fState = StateType.Closed; fSettings = null; fCapabilities = null; }
public EditSession StartEditing (Gdk.Rectangle cell_area, StateType state) { IPropertyEditor ed = CreateEditor (cell_area, state); if (ed == null) return null; return new EditSession (container, obj, property, ed); }
protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, StateType state) { if (Property.Converter.CanConvertTo (typeof(string)) && Property.Converter.CanConvertFrom (typeof(string))) return new TextEditor (); else return null; }
public static void Add(string description, string userName, Device panelDevice = null, Device device = null, Zone zone = null, StateType stateType = StateType.Info) { var journalItem = new FS2JournalItem { DeviceTime = DateTime.Now, SystemTime = DateTime.Now, Description = description, UserName = userName, PanelDevice = panelDevice, Device = device, StateType = stateType, SubsystemType = SubsystemType.Other, }; if (panelDevice != null) { journalItem.PanelName = panelDevice.DottedPresentationNameAndAddress; journalItem.PanelUID = panelDevice.UID; } if (device != null) { journalItem.DeviceName = device.DottedPresentationNameAndAddress; journalItem.DeviceUID = device.UID; } if (zone != null) { journalItem.ZoneNo = zone.No; journalItem.ZoneName = zone.PresentationName; } AddJournalItem(journalItem); }
public override void Render(CellContext context, StateType state, double cellWidth, double cellHeight) { if (BoundObject == null) { return; } if (!(BoundObject is TrackInfo)) { throw new InvalidCastException ("CubanoTitleCell can only bind to TrackInfo objects"); } TrackInfo track = (TrackInfo)BoundObject; context.Layout.Width = (int)((cellWidth - 8) * Pango.Scale.PangoScale); context.Layout.Ellipsize = Pango.EllipsizeMode.End; //context.Layout.FontDescription = context.Widget.PangoContext.FontDescription.Copy (); context.Layout.FontDescription.Weight = font_weight; context.Layout.SetMarkup (String.Format ("<big>{0}</big> {1}", track.TrackNumber, GLib.Markup.EscapeText (track.DisplayTrackTitle))); int text_width; int text_height; context.Layout.GetPixelSize (out text_width, out text_height); context.Context.MoveTo (4, ((int)cellHeight - text_height) / 2); Cairo.Color color = context.Theme.Colors.GetWidgetColor ( context.TextAsForeground ? GtkColorClass.Foreground : GtkColorClass.Text, state); color.A = (!context.Sensitive) ? 0.3 : 1.0; context.Context.Color = color; PangoCairoHelper.ShowLayout (context.Context, context.Layout); }
void Start() { data = MainSystem.Instance.gameData; nowType = StateType.human; SetTexture (nowType); SetData (); GUIController.Instance.SetCoolTime (data.StomacCoolTime, data.TrainingCoolTime, data.PreachingCoolTime); GUIController.Instance.OnButtonDownStomac = () => { Stomac += data.GainStomacValue * (1 - Hotoke * 0.005f); }; GUIController.Instance.OnButtonDownTreaning = () => { Hotoke += data.GainHotokeValue; hide = true; }; GUIController.Instance.OnButtonDownPreaching = () => { Faith += data.GainFaithValue * (1 + Hotoke * 0.01f); hide = true; }; GUIController.Instance.OnCoolFinish = () => { hide = false; }; }
public void Push( Vector3 dir ) { transform.position = PlayerControl.player.transform.position; rigidbody.velocity = dir.normalized * PlayerControl.HandPushspeed; state = StateType.Throw; Debug.Log("Push"); }
void CheckLength() { if( ( transform.position - PlayerControl.player.transform.position ).magnitude > LengthLimitation ) { state = StateType.Recive; } }
void Awake() { // 減算から開始する stateType = StateType.Sub; image = GetComponent<Image>(); color = image.color; }
public override void Render(Drawable window, Widget widget, Rectangle cell_area, Rectangle expose_area, StateType cell_state, IPhoto photo) { string text = GetRenderText (photo); var layout = new Pango.Layout (widget.PangoContext); layout.SetText (text); Rectangle layout_bounds; layout.GetPixelSize (out layout_bounds.Width, out layout_bounds.Height); layout_bounds.Y = cell_area.Y; layout_bounds.X = cell_area.X + (cell_area.Width - layout_bounds.Width) / 2; if (layout_bounds.IntersectsWith (expose_area)) { Style.PaintLayout (widget.Style, window, cell_state, true, expose_area, widget, "IconView", layout_bounds.X, layout_bounds.Y, layout); } }
public StateTypeSet(StateSystem statesystem, String label, TextSection textsection) : base(statesystem, label, textsection) { m_statetype = textsection.GetAttribute<StateType>("statetype", StateType.Unchanged); m_movetype = textsection.GetAttribute<MoveType>("movetype", MoveType.Unchanged); m_physics = textsection.GetAttribute<Physics>("Physics", Physics.Unchanged); }
public void ChangeState(StateType type) { if (EditPanel.LayerInfo == null) return; switch (type) { case StateType.CreateButton: m_currentState = new CreateControlState(new CreateButton(m_editPanel), this, m_commandManager); break; case StateType.CreateLabel: m_currentState = new CreateControlState(new CreateLabel(m_editPanel), this, m_commandManager); break; case StateType.CreatePanel: m_currentState = new CreateControlState(new CreatePanel(m_editPanel), this, m_commandManager); break; case StateType.Move: m_currentState = new MoveState(m_editPanel.SelectedControls, this, m_commandManager); break; case StateType.Resize: m_currentState = new ResizeControlState(m_editPanel.SelectedControls, this, m_commandManager, m_flagPosition); break; case StateType.Idle: m_currentState = new IdleState(m_editPanel, this, m_commandManager); break; } }
public IEnumerable<Tuple<DiagnosticState, ProviderId, StateType>> GetAllExistingDiagnosticStates(StateType type, string languageOpt) { if (languageOpt != null) { PerLanguageAnalyzersAndStates analyzersStates; if (_perLanguageAnalyzersAndStatesMap.TryGetValue(languageOpt, out analyzersStates)) { return analyzersStates.GetAllExistingDiagnosticStates(type); } else { return SpecializedCollections.EmptyEnumerable<Tuple<DiagnosticState, ProviderId, StateType>>(); } } // This might be a removed or closed document/project/solution. // Return all existing states. var current = SpecializedCollections.EmptyEnumerable<Tuple<DiagnosticState, ProviderId, StateType>>(); foreach (var analyzersAndStates in _perLanguageAnalyzersAndStatesMap.Values) { current = current.Concat(analyzersAndStates.GetAllExistingDiagnosticStates(type)); } return current; }
public void SwitchState(StateType type) { switch (type) { case StateType.MainMenu: if (Logic.CurrentParty != null && Logic.CurrentWorld != null) { for (int i = 0; i < Logic.CurrentParty.MainParty.MyParty.Count; i++) { Logic.CurrentParty.MainParty.MyParty[i].CurMap.SpawnedLivingThing[Logic.CurrentParty.MainParty.MyParty[i].Y + Logic.CurrentParty.MainParty.MyParty[i].CurMap.MinY][Logic.CurrentParty.MainParty.MyParty[i].X + Logic.CurrentParty.MainParty.MyParty[i].CurMap.MinX].Remove(Logic.CurrentParty.MainParty.MyParty[i].Index); Logic.CurrentParty.MainParty.MyParty[i].CurMap.LivingThing[Logic.CurrentParty.MainParty.MyParty[i].Index] = null; } CurrentState = 0; } break; case StateType.InGame: if (Logic.CurrentParty != null && Logic.CurrentWorld != null) { for (int i = 0; i < Logic.CurrentParty.MainParty.MyParty.Count; i++) { Logic.CurrentParty.MainParty.MyParty[i].OnMapType = Logic.CurrentWorld.SpawnPlaceMapType; Logic.CurrentParty.MainParty.MyParty[i].SideMapID = Logic.CurrentWorld.SpawnMapIndex; Logic.CurrentParty.MainParty.MyParty[i].X = Logic.CurrentWorld.SpawnMapX; Logic.CurrentParty.MainParty.MyParty[i].Y = Logic.CurrentWorld.SpawnMapY; Logic.CurrentParty.MainParty.MyParty[i].PutOnMap(); InGameState s = (InGameState)Program.SM.States[1]; s.Initialize(); CurrentState = 1; } } break; } }
protected override void observer(StateType x, double t) { if (OdeObserver != null) { OdeObserver(x, t); } }
/// <summary> /// Construct a <see cref="ZoomState"/> object from the scale ranges settings contained /// in the specified <see cref="GraphPane"/>. /// </summary> /// <param name="pane">The <see cref="GraphPane"/> from which to obtain the scale /// range values. /// </param> /// <param name="type">A <see cref="StateType"/> enumeration that indicates whether /// this saved state is from a pan or zoom.</param> public ZoomState(GraphPane pane, StateType type) { _xAxis = new ScaleState(pane.XAxis); _yAxis = new ScaleStateList(pane.YAxisList); _y2Axis = new ScaleStateList(pane.Y2AxisList); _type = type; }
public override void Render (CellContext context, StateType state, double cellWidth, double cellHeight) { if (data_handler == null) { return; } if (!has_sort) { base.Render (context, state, cellWidth, cellHeight); return; } Gdk.Rectangle arrow_alloc = new Gdk.Rectangle (); arrow_alloc.Width = (int)(cellHeight / 3.0); arrow_alloc.Height = (int)((double)arrow_alloc.Width / 1.6); arrow_alloc.X = (int)cellWidth - arrow_alloc.Width - Spacing; arrow_alloc.Y = ((int)cellHeight - arrow_alloc.Height) / 2; double textWidth = arrow_alloc.X - Spacing; if (textWidth > 0) { base.Render (context, state, textWidth, cellHeight); } SortType sort_type = ((ISortableColumn)data_handler ()).SortType; if (sort_type != SortType.None) { context.Theme.DrawArrow (context.Context, arrow_alloc, sort_type); } }
protected override void system(StateType x, StateType dxdt, double t) { if (OdeSystem != null) { OdeSystem(x, dxdt, t); } }
protected override void observer(StateType x, double t) { if (x.Capacity != 0) { Console.WriteLine("{0} : {1} : {2}", x[0], x[1], x[2]); } }
public EditSession StartEditing (Rectangle cellArea, StateType state) { IPropertyEditor ed = CreateEditor (cellArea, state); if (ed == null) return null; return new EditSession (container, context, ed); }
public DeviceViewModel(DeviceState deviceState) { DeviceState = deviceState; _stateType = deviceState.StateType; FiresecCallbackService.DeviceStateChangedEvent += new Action<Guid>(OnDeviceStateChangedEvent); Name = DeviceState.Device.Driver.ShortName + " - " + DeviceState.Device.DottedAddress; }
public void GoToState( StateType newState ) { if ( curState != null ) { curState.UnLoad(); } switch ( newState ) { case StateType.Menu: Header.ShowBack = false; Header.IsShow = true; Header.UpdateInfo(); curState = Menu; break; case StateType.Character: Header.ShowBack = true; curState = Character; break; case StateType.Map: Header.ShowBack = true; curState = Map; break; case StateType.MatchScore: curState = MatchScore; break; case StateType.EnterName: curState = EnterName; break; default: Debug.LogError( "state " + newState + " doesn't implemented!" ); break; } curState.Load(); }
public ZoneViewModel(ZoneState zoneState) { ZoneState = zoneState; _stateType = zoneState.StateType; ItvManager.ZoneStateChanged += new Action<ZoneState>(OnZoneStateChanged); No = zoneState.Zone.No; Name = zoneState.Zone.Name; }
public void InitState(StateType type, int duration, int stateId) { Debug.Log("[" + type + "] Duration:" + duration); id = stateId; sprite.sprite2D = uiManager.GetStateSprite(type); curDuration = duration; label.text = curDuration.ToString(); }
public Lexer(String filePath) { buffer = file.ReadFile(filePath); //读取指针从(0,0)开始. readLineNum = 0; readColNum = -1;//每次调用GetNextCharFromBuffer需要自增1; currentState = StateType.START; }
public void Reset() { xRange.Reset(); yRange.Reset(); //isStickOutLEFT = false; //isStickOutRIGHT = false; state = StateType.None; }
/// <summary> /// Construct a <see cref="ZoomStateGroup"/> object from the scale ranges settings contained /// in each <see cref="GraphPane" /> for the specified <see cref="MasterPane"/>. /// </summary> /// <param name="masterPane">The <see cref="MasterPane"/> from which to obtain the scale /// range values. /// </param> /// <param name="type">A <see cref="ZoomState.StateType"/> enumeration that indicates whether /// this saved state is from a pan, zoom, or scroll.</param> public ZoomStateGroup( MasterPane masterPane, StateType type ) : base(type) { _stack = new ZoomStateStack(); foreach ( GraphPane pane in masterPane._paneList ) _stack.Add( new ZoomState( pane, type ) ); }
public AllocationManager(Animation anim, StateType type, AllocationManager previous = null) { this.anim = anim; this.type = type; RootWidget root = anim.AnimLayer.RootWidget; deckCards = new PlayingCardListAllocator(this, root.DeckPlaceholder); graveyardCards = new PlayingCardListAllocator(this, root.GraveyardPlaceholder); selectionCards = new PlayingCardListAllocator(this, root.SelectionPlaceholder); IGame game = ConnectionManager.Game; int count = game.Players.Count; playerHands = new Dictionary<int, PlayingCardListAllocator>(count); playerTables = new Dictionary<int, PlayingCardListAllocator>(count); playerLifePoints = new Dictionary<int, LifePointsCardAllocator>(count); playerRoles = new Dictionary<int, RoleCardAllocator>(count); foreach(IPublicPlayerView player in game.Players) { int playerId = player.ID; playerHands.Add(playerId, new PlayingCardListAllocator(this, root.GetPlayerHandPlaceholder(playerId))); playerTables.Add(playerId, new PlayingCardListAllocator(this, root.GetPlayerTablePlaceholder(playerId))); playerLifePoints.Add(playerId, new LifePointsCardAllocator(this, root.GetPlayerCharacterPlaceholder(playerId), anim.GetPlayerCharacterAnimator(playerId))); playerRoles.Add(playerId, new RoleCardAllocator(this, root.GetPlayerRolePlaceholder(playerId), anim.GetPlayerRoleAnimator(playerId))); } playingCardZoom = new CardZoomAllocator(this, anim.AnimLayer, anim.GetPlayingCardZoomAnimator()); roleCardZoom = new CardZoomAllocator(this, anim.AnimLayer, anim.GetRoleCardZoomAnimator()); characterCardZoom = new CardZoomAllocator(this, anim.AnimLayer, anim.GetCharacterCardZoomAnimator()); if(previous != null) { int thisPlayerId = 0; if(ConnectionManager.PlayerGameControl != null) thisPlayerId = ConnectionManager.PlayerGameControl.PrivatePlayerView.ID; List<PlayingCardAnimator> lastGraveyard = previous.graveyardCards.Animators; if(lastGraveyard.Count != 0) { PlayingCardAnimator prev = lastGraveyard[lastGraveyard.Count - 1]; PlayingCardAnimator a = anim.GetPlayingCardAnimator(prev.ID); a.GetState(type).Update(prev.GetState(previous.type)); this.graveyardCards.Animators.Add(a); } UpdateList(this.selectionCards, previous.selectionCards, previous.type); foreach(int id in previous.playerHands.Keys) UpdateList(this.playerHands[id], previous.playerHands[id], previous.type, type == StateType.End && id != thisPlayerId); foreach(int id in previous.playerTables.Keys) UpdateList(this.playerTables[id], previous.playerTables[id], previous.type); foreach(int id in previous.playerLifePoints.Keys) this.playerLifePoints[id].LifePoints = previous.playerLifePoints[id].LifePoints; this.playingCardZoom.Visible = previous.playingCardZoom.Visible; this.roleCardZoom.Visible = previous.roleCardZoom.Visible; this.characterCardZoom.Visible = previous.characterCardZoom.Visible; } }
protected override void system(StateType x, StateType dxdt, double t) { const double sigma = 10.0; const double r = 28.0; const double b = 8.0/3.0; dxdt[0] = sigma * (x[1] - x[0]); dxdt[1] = r * x[0] - x[1] - x[0] * x[2]; dxdt[2] = -b * x[2] + x[0] * x[1]; }
public void OnClicked() { if (isCliked == true) return; isCliked = true; color.a = 1.0f; nowTime = 0.0f; stateType = StateType.Sub; }
static bool IsTemplateRowSelected(Widget widget, CellRendererState flags) { StateType stateType = GetState(widget, flags); return((stateType == StateType.Selected) || (stateType == StateType.Active)); }
private bool ShouldRunAnalyzerForStateType(DiagnosticAnalyzer analyzer, StateType stateTypeId, ImmutableHashSet <string> diagnosticIds) { return(ShouldRunAnalyzerForStateType(analyzer, stateTypeId, diagnosticIds, Owner.GetDiagnosticDescriptors)); }
/// <summary> /// 对显示控件设置State /// </summary> public void SetState(StateType state) { StateControlHelper.SetState(this, state); }
public void StateUpdated(DataContainer dataContainer, StateType state) { ArgumentUtility.CheckNotNull("dataContainer", dataContainer); _eventSink.RaiseDataContainerStateUpdatedEvent(dataContainer, state); }
private static ArgumentKey CreateArgumentKey(StateType type, object key, StateSet stateSet) { return(stateSet.ErrorSourceName != null ? new HostAnalyzerKey(stateSet.Analyzer, type, key, stateSet.ErrorSourceName) : new ArgumentKey(stateSet.Analyzer, type, key)); }
public void TypeIsNotClass() { Assert.IsFalse(StateType.Is(WorkitemType)); }
private void Error() { _message = String.Format("Error encountered loading {0}", _url); State = StateType.Error; }
public virtual void Render(Gdk.Drawable window, Cairo.Context ctx, Gdk.Rectangle bounds, StateType state) { int w, h; layout.GetPixelSize(out w, out h); int dy = (bounds.Height - h) / 2; ctx.Save(); ctx.Color = container.Style.Text(state).ToCairoColor(); ctx.MoveTo(bounds.X, dy + bounds.Y); Pango.CairoHelper.ShowLayout(ctx, layout); ctx.Restore(); }
private void Awake() { state = StateType.Spawn; boxCollider = GetComponent <BoxCollider>(); }
protected override async Task AppendDocumentDiagnosticsOfStateTypeAsync(Document document, StateType stateType, CancellationToken cancellationToken) { foreach (var stateSet in this.StateManager.GetStateSets(document.Project)) { cancellationToken.ThrowIfCancellationRequested(); var state = stateSet.GetState(stateType); var existingData = await state.TryGetExistingDataAsync(document, cancellationToken).ConfigureAwait(false); if (existingData == null || existingData.Items.Length == 0) { continue; } AppendDiagnostics(existingData.Items); } }
protected abstract Task AppendDocumentDiagnosticsOfStateTypeAsync(Document document, StateType stateType, CancellationToken cancellationToken);
protected abstract Task <AnalysisData> GetDiagnosticAnalysisDataAsync(DiagnosticAnalyzerDriver analyzerDriver, StateSet stateSet, StateType stateType, VersionArgument versions);
protected override Task AppendDocumentDiagnosticsOfStateTypeAsync(Document document, StateType stateType, CancellationToken cancellationToken) { return(AppendDiagnosticsOfStateTypeAsync(document, stateType, d => true, cancellationToken)); }
protected async Task <DiagnosticAnalyzerDriver> GetDiagnosticAnalyzerDriverAsync( object documentOrProject, IEnumerable <DiagnosticAnalyzer> analyzers, StateType stateType, CancellationToken cancellationToken) { // We can run analysis concurrently for explicit diagnostic requests. const bool concurrentAnalysis = true; // We need to compute suppressed diagnostics - diagnostic clients may or may not request for suppressed diagnostics. const bool reportSuppressedDiagnostics = true; var document = documentOrProject as Document; if (document != null) { Contract.Requires(stateType != StateType.Project); var compilationWithAnalyzersOpt = await GetCompilationWithAnalyzersAsync(document.Project, analyzers, concurrentAnalysis, reportSuppressedDiagnostics, cancellationToken).ConfigureAwait(false); var root = document.SupportsSyntaxTree ? await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false) : null; return(new DiagnosticAnalyzerDriver(document, root?.FullSpan, root, Owner, analyzers, concurrentAnalysis, reportSuppressedDiagnostics, compilationWithAnalyzersOpt, cancellationToken)); } var project = documentOrProject as Project; if (project != null) { Contract.Requires(stateType == StateType.Project); var compilationWithAnalyzersOpt = await GetCompilationWithAnalyzersAsync(project, analyzers, concurrentAnalysis, reportSuppressedDiagnostics, cancellationToken).ConfigureAwait(false); return(new DiagnosticAnalyzerDriver(project, Owner, analyzers, concurrentAnalysis, reportSuppressedDiagnostics, compilationWithAnalyzersOpt, cancellationToken)); } return(Contract.FailWithReturn <DiagnosticAnalyzerDriver>("Can't reach here")); }
public void TypeIsSelf() { Assert.IsTrue(StateType.Is(StateType)); }
/// <summary> /// Spawnアニメが終わったら、アニメからこのメソッドを呼び出します。 /// </summary> public void ToFly() { CanAction = true; state = StateType.Fly; }
public void TypeIsNotType() { Assert.IsFalse(StateType.Is(StoryType)); }
public MissionCompleteState(StateType sType) : base(sType) { }
private void TimeOut() { _message = String.Format("Timeout encountered loading {0}", _url); State = StateType.Error; }
public HostAnalyzerKey(DiagnosticAnalyzer analyzer, StateType stateType, object key, string analyzerPackageName) : base(analyzer, stateType, key) { _analyzerPackageName = analyzerPackageName; }
private void LoadData(string textReceived) { // received data, set the state vars and send statechange _data = textReceived; State = StateType.Received; }
public ArgumentKey(DiagnosticAnalyzer analyzer, StateType stateType, object key) : base(analyzer) { StateType = stateType; Key = key; }
/// <summary> /// Восстанавливает состояние пациента из пришедших из базы данных и осуществляет вызов метода перехода в новое состояние /// </summary> /// <param name="currentStateType"></param> /// <param name="currentStatus"></param> /// <returns>Возвращает новое состояние</returns> public static StateType ProcessPatient(StateType currentStateType, Status currentStatus) { var currentState = StateSwitch[currentStateType](); return(currentState.NextState(currentStatus).StateType); }
private async Task ClearExistingDiagnostics(Document document, StateSet stateSet, StateType type, CancellationToken cancellationToken) { var state = stateSet.GetState(type); var existingData = await state.TryGetExistingDataAsync(document, cancellationToken).ConfigureAwait(false); if (existingData?.Items.Length > 0) { ClearDocumentState(document, stateSet, type, raiseEvent: true); } }
private static bool ShouldRunAnalyzerForStateType(DiagnosticAnalyzer analyzer, StateType stateTypeId, ImmutableHashSet <string> diagnosticIds = null, Func <DiagnosticAnalyzer, ImmutableArray <DiagnosticDescriptor> > getDescriptors = null) { // PERF: Don't query descriptors for compiler analyzer, always execute it for all state types. if (analyzer.IsCompilerAnalyzer()) { return(true); } if (diagnosticIds != null && getDescriptors(analyzer).All(d => !diagnosticIds.Contains(d.Id))) { return(false); } switch (stateTypeId) { case StateType.Syntax: return(analyzer.SupportsSyntaxDiagnosticAnalysis()); case StateType.Document: return(analyzer.SupportsSemanticDiagnosticAnalysis()); case StateType.Project: return(analyzer.SupportsProjectDiagnosticAnalysis()); default: throw ExceptionUtilities.Unreachable; } }
public abstract void Render(Drawable window, Widget widget, Rectangle cell_area, Rectangle expose_area, StateType cell_state, IPhoto photo);
public Death(ICharacter actor) { Type = StateType.Death; owner = actor; }
protected async Task <VersionArgument> GetVersionsAsync(object documentOrProject, StateType stateType, CancellationToken cancellationToken) { switch (stateType) { case StateType.Syntax: { var document = (Document)documentOrProject; var textVersion = await document.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); var syntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false); return(new VersionArgument(textVersion, syntaxVersion)); } case StateType.Document: { var document = (Document)documentOrProject; var textVersion = await document.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); var semanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); return(new VersionArgument(textVersion, semanticVersion)); } case StateType.Project: { var project = (Project)documentOrProject; var projectTextVersion = await project.GetLatestDocumentVersionAsync(cancellationToken).ConfigureAwait(false); var semanticVersion = await project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); var projectVersion = await project.GetDependentVersionAsync(cancellationToken).ConfigureAwait(false); return(new VersionArgument(projectTextVersion, semanticVersion, projectVersion)); } default: return(Contract.FailWithReturn <VersionArgument>("Can't reach here")); } }
public Cell(int xCoordinate, int yCoordinate, StateType state) { this.XCoordinate = xCoordinate; this.YCoordinate = yCoordinate; State = (StateType)state; }
private async Task AppendDiagnosticsOfStateTypeAsync(object documentOrProject, StateType stateType, Func <DiagnosticData, bool> predicateOpt, CancellationToken cancellationToken) { Contract.ThrowIfNull(documentOrProject); var project = GetProject(documentOrProject); var versions = await GetVersionsAsync(documentOrProject, stateType, cancellationToken).ConfigureAwait(false); var stateSets = this.StateManager.GetOrCreateStateSets(project); var analyzers = stateSets.Select(s => s.Analyzer); var driver = await GetDiagnosticAnalyzerDriverAsync(documentOrProject, analyzers, stateType, cancellationToken).ConfigureAwait(false); foreach (var stateSet in stateSets) { cancellationToken.ThrowIfCancellationRequested(); if (Owner.Owner.IsAnalyzerSuppressed(stateSet.Analyzer, project) || !this.Owner.ShouldRunAnalyzerForStateType(stateSet.Analyzer, stateType, this.DiagnosticIds)) { continue; } var analysisData = await GetDiagnosticAnalysisDataAsync(driver, stateSet, stateType, versions).ConfigureAwait(false); FilterDiagnostics(analysisData, predicateOpt); } }