本文整理汇总了C#中DocumentEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DocumentEventArgs类的具体用法?C# DocumentEventArgs怎么用?C# DocumentEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocumentEventArgs类属于命名空间,在下文中一共展示了DocumentEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Workspace_DocumentOpened
private void Workspace_DocumentOpened(object sender, DocumentEventArgs e)
{
lock (_gate)
{
_openDocumentContexts.Add(e.Document.Id, Task.Run(() => GetConventionContextAsync(e.Document.FilePath, CancellationToken.None)));
}
}
示例2: HandleDocumentClosed
void HandleDocumentClosed (object sender, DocumentEventArgs e)
{
if (e.Document == null || e.Document.Editor == null || e.Document.Editor.Parent == null) return;
e.Document.Editor.Parent.ButtonReleaseEvent -= HandleButtonReleaseEvent;
e.Document.Editor.Parent.MotionNotifyEvent -= HandleMotionNotifyEvent;
}
示例3: OnDocumentActiveContextChanged
private void OnDocumentActiveContextChanged(object sender, DocumentEventArgs e)
{
var document = SubjectBuffer.AsTextContainer().GetOpenDocumentInCurrentContext();
if (document != null && document.Id == e.Document.Id)
{
this.RaiseChanged();
}
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:9,代码来源:TaggerEventSources.DocumentActiveContextChangedEventSource.cs
示例4: OnDocumentOpened
private void OnDocumentOpened(object sender, DocumentEventArgs e)
{
InvokeBelowInputPriority(() =>
{
if (!_isDisposed)
{
SetReadOnly(e.Document);
}
});
}
示例5: OnDocumentClosed
private void OnDocumentClosed(object sender, DocumentEventArgs e)
{
// The buffer is gone by now, so we don't need to remove the read-only region from it, just clean up our dictionary.
InvokeBelowInputPriority(() =>
{
if (_readOnlyRegions != null)
{
_readOnlyRegions.Remove(e.Document.Id);
}
});
}
示例6: Workspace_DocumentClosed
private void Workspace_DocumentClosed(object sender, DocumentEventArgs e)
{
lock (_gate)
{
if (_openDocumentContexts.TryGetValue(e.Document.Id, out var contextTask))
{
_openDocumentContexts.Remove(e.Document.Id);
// Ensure we dispose the context, which we'll do asynchronously
contextTask.ContinueWith(
t => t.Result.Dispose(),
CancellationToken.None,
TaskContinuationOptions.OnlyOnRanToCompletion,
TaskScheduler.Default);
}
}
}
示例7: HandleDocumentOpened
void HandleDocumentOpened (object sender, DocumentEventArgs e)
{
if (!(e.Document.Project is DotNetProject) || !e.Document.IsFile)
return;
string ext = e.Document.FileName;
if (!ext.EndsWith (".addin.xml") && !ext.EndsWith (".addin"))
return;
var data = AddinData.GetAddinData ((DotNetProject)e.Document.Project);
if (data != null) {
IWorkbenchWindow window = e.Document.Window;
var adesc = data.AddinRegistry.ReadAddinManifestFile (e.Document.FileName);
window.AttachViewContent (new ExtensionEditorView (adesc, data));
window.AttachViewContent (new ExtensionPointsEditorView (adesc, data));
}
}
示例8: OnDocumentOpened
private void OnDocumentOpened(object sender, DocumentEventArgs args)
{
this.Parse(args.Document);
}
示例9: OnDocumentOpened
private void OnDocumentOpened(object sender, DocumentEventArgs e)
{
InvokeBelowInputPriority(() => TrackDocument(e.Document.Id));
}
示例10: events_DocumentClosing
private void events_DocumentClosing(DocumentEventArgs ea)
{
UpdateMarkerList();
}
示例11: OnDocumentClosed
private void OnDocumentClosed(object sender, DocumentEventArgs args)
{
this.CancelParse(args.Document.Id);
}
示例12: OnDocumentOpened
private void OnDocumentOpened(object sender, DocumentEventArgs args)
{
if (_workspace != null)
{
ParseIfThisDocument(null, args.Document.Project.Solution, args.Document.Id);
}
}
示例13: NewDocumentCreatedEventHandler
/// <summary>
/// The event handler is creating a new document.
/// </summary>
/// <param name="args"></param>
protected override void NewDocumentCreatedEventHandler(DocumentEventArgs args)
{
args.Document.AttachPlugin(this);
}
示例14: OnDocumentClosed
private void OnDocumentClosed(object sender, DocumentEventArgs e)
{
var asyncToken = _listener.BeginAsyncOperation("OnDocumentClosed");
_eventProcessingQueue.ScheduleTask(
() => EnqueueWorkItemAsync(e.Document, InvocationReasons.DocumentClosed), _shutdownToken).CompletesAsyncOperation(asyncToken);
}
示例15: OnDocumentActiveContextChanged
private void OnDocumentActiveContextChanged(object sender, DocumentEventArgs e)
{
Reanalyze(e.Document.Project.Solution.Workspace, documentIds: SpecializedCollections.SingletonEnumerable(e.Document.Id));
}