本文整理汇总了C#中IProgressIndicator.Start方法的典型用法代码示例。如果您正苦于以下问题:C# IProgressIndicator.Start方法的具体用法?C# IProgressIndicator.Start怎么用?C# IProgressIndicator.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProgressIndicator
的用法示例。
在下文中一共展示了IProgressIndicator.Start方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertMethods
private bool ConvertMethods(IProgressIndicator pi)
{
if (base.NewMembers == null) return false;
const int totalWorkUnits = 3;
pi.Start(totalWorkUnits);
var myWorkflow = Workflow as SharedToExtensionWorkflow;
if (myWorkflow != null)
Methods = base.NewMembers.OfType<IMethod>().ToList();
using (var progressIndicator = pi.CreateSubProgress(1.0))
FindUsages(progressIndicator);
var isSharedToExtension = (this.Direction == SharedToExtensionWorkflow.WorkflowDirection.SharedToExtension);
this.Methods.ForEachWithProgress(pi.CreateSubProgress(1.0), "",
method => {
this.Constructors[method.PresentationLanguage].MakeFirstPrameterThis(method, isSharedToExtension, this.Driver);
method.GetPsiServices().Caches.Update();
});
if (isSharedToExtension)
using (var progressIndicator = pi.CreateSubProgress(1.0))
MakeCallExtension(progressIndicator);
else
using (var progressIndicator = pi.CreateSubProgress(1.0))
MakeCallShared(progressIndicator);
return true;
}
示例2: VisitProject
public override void VisitProject(IProject project)
{
if (project.LanguageType == ProjectFileType.UNKNOWN)
return;
SetupCandidates(project);
using(SubProgressIndicator projectIndicator = new SubProgressIndicator(progressIndicator, 1))
{
currentIndicator = projectIndicator;
int filesCount = ProjectUtil.GetFileCount(project);
currentIndicator.Start(filesCount);
base.VisitProject(project);
results[project] = CreateProjectResults(project);
currentIndicator = NullProgressIndicator.INSTANCE;
}
}
示例3: Deobfuscate
private FileSystemPath Deobfuscate(IObfuscatedFile obfuscatedFile, IProgressIndicator progressIndicator)
{
try
{
progressIndicator.Start(5);
progressIndicator.TaskName = "Deobfuscating...";
progressIndicator.CurrentItemText = string.Format("Saving to {0}", obfuscatedFile.NewFilename);
progressIndicator.Advance(1);
obfuscatedFile.deobfuscateBegin();
progressIndicator.Advance(1);
obfuscatedFile.deobfuscate();
progressIndicator.Advance(1);
obfuscatedFile.deobfuscateEnd();
// turn all flags on
RenamerFlags flags = RenamerFlags.DontCreateNewParamDefs | RenamerFlags.DontRenameDelegateFields |
RenamerFlags.RenameEvents |
RenamerFlags.RenameFields | RenamerFlags.RenameGenericParams |
RenamerFlags.RenameMethodArgs |
RenamerFlags.RenameMethods | RenamerFlags.RenameNamespaces |
RenamerFlags.RenameProperties |
RenamerFlags.RenameTypes | RenamerFlags.RestoreEvents |
RenamerFlags.RestoreEventsFromNames |
RenamerFlags.RestoreProperties | RenamerFlags.RestorePropertiesFromNames;
var renamer = new Renamer(obfuscatedFile.DeobfuscatorContext, new[] { obfuscatedFile }, flags);
progressIndicator.Advance(1);
renamer.rename();
progressIndicator.Advance(1);
obfuscatedFile.save();
}
finally
{
progressIndicator.Stop();
}
return new FileSystemPath(obfuscatedFile.NewFilename);
}
示例4: Search
public override ICollection<IOccurence> Search(IProgressIndicator progressIndicator)
{
// Create and configure utility class, which will perform search
var searcher = new StringSearcher(mySearchString, myCaseSensitive);
// Fetch all projects for solution, start progress
ICollection<IProject> projects = Solution.GetAllProjects();
progressIndicator.Start(projects.Count);
var items = new List<IOccurence>();
// visit each project and collect occurences
var visitor = new ProjectTextSearcher(searcher, items, mySearchFlags, myDocumentManager, mySolution);
foreach (IProject project in projects)
{
progressIndicator.CurrentItemText = string.Format("Scanning project '{0}'", project.Name);
project.Accept(visitor);
progressIndicator.Advance(1);
}
return items;
}
示例5: Rename
public override void Rename(RenameRefactoring executer, IProgressIndicator pi, bool hasConflictsWithDeclarations, IRefactoringDriver driver)
{
BuildDeclarations();
//Logger.Assert(myDeclarations.Count > 0, "myDeclarations.Count > 0");
IDeclaredElement declaredElement = myOriginalElementPointer.FindDeclaredElement();
if (declaredElement == null)
{
return;
}
IPsiServices psiServices = declaredElement.GetPsiServices();
IList<IReference> primaryReferences = executer.Workflow.GetElementReferences(PrimaryDeclaredElement);
List<Pair<IDeclaredElement, IList<IReference>>> secondaryElementWithReferences = SecondaryDeclaredElements.Select(x => Pair.Of(x, executer.Workflow.GetElementReferences(x))).ToList();
pi.Start(myDeclarations.Count + primaryReferences.Count);
foreach (IDeclaration declaration in myDeclarations)
{
InterruptableActivityCookie.CheckAndThrow(pi);
declaration.SetName(myNewName);
pi.Advance();
}
psiServices.PsiManager.UpdateCaches();
IDeclaredElement newDeclaredElement = null;
if (myDeclarations.Count > 0)
{
newDeclaredElement = myDeclarations[0].DeclaredElement;
}
Assertion.Assert(newDeclaredElement != null, "The condition (newDeclaredElement != null) is false.");
myNewElementPointer = newDeclaredElement.CreateElementPointer();
Assertion.Assert(newDeclaredElement.IsValid(), "myNewDeclaredElement.IsValid()");
myNewReferences.Clear();
OneToSetMap<PsiLanguageType, IReference> references = LanguageUtil.SortReferences(primaryReferences.Where(x => x.IsValid()));
IList<IReference> referencesToRename = new List<IReference>();
foreach (var pair in references)
{
List<IReference> sortedReferences = LanguageUtil.GetSortedReferences(pair.Value);
foreach (IReference reference in sortedReferences)
{
IReference oldReferenceForConflict = reference;
InterruptableActivityCookie.CheckAndThrow(pi);
if (reference.IsValid()) // reference may invalidate during additional reference processing
{
RenameHelperBase rename = executer.Workflow.LanguageSpecific[reference.GetTreeNode().Language];
IReference reference1 = rename.TransformProjectedInitializer(reference);
DeclaredElementInstance subst = GetSubst(newDeclaredElement, executer);
IReference newReference;
if (subst != null)
{
if (subst.Substitution.Domain.IsEmpty())
{
newReference = reference1.BindTo(subst.Element);
}
else
{
newReference = reference1.BindTo(subst.Element, subst.Substitution);
}
}
else
{
newReference = reference1.BindTo(newDeclaredElement);
}
if (!(newReference is IImplicitReference))
{
IDeclaredElement element = newReference.Resolve().DeclaredElement;
if (!hasConflictsWithDeclarations && !myDoNotShowBindingConflicts && (element == null || !element.Equals(newDeclaredElement)) && !rename.IsAlias(newDeclaredElement))
{
driver.AddLateConflict(() => new Conflict(newReference.GetTreeNode().GetSolution(), "Usage {0} can not be updated correctly.", ConflictSeverity.Error, oldReferenceForConflict), "not bound");
}
referencesToRename.Add(newReference);
}
myNewReferences.Insert(0, newReference);
rename.AdditionalReferenceProcessing(newDeclaredElement, newReference, myNewReferences);
}
pi.Advance();
}
}
foreach (var pair in secondaryElementWithReferences)
{
IDeclaredElement element = pair.First;
IList<IReference> secondaryReferences = pair.Second;
foreach (IReference reference in secondaryReferences)
{
InterruptableActivityCookie.CheckAndThrow(pi);
if (reference.IsValid())
{
reference.BindTo(element);
}
}
}
//.........这里部分代码省略.........
示例6: RecoverAfterExternalChanges
public bool RecoverAfterExternalChanges(IProgressIndicator progressIndicator)
{
progressIndicator.Start(1);
progressIndicator.Stop();
return true;
}
示例7: RefreshContents
public bool RefreshContents(IProgressIndicator pi)
{
pi.Start(1);
pi.Stop();
return true;
}
示例8: Initialize
public bool Initialize(IProgressIndicator pi)
{
pi.Start(1);
pi.Stop();
return true;
}
示例9: Execute
public override bool Execute(IProgressIndicator pi)
{
const int totalWorkUnits = 2;
pi.Start(totalWorkUnits);
return base.Execute(pi.CreateSubProgress(1.0)) && ConvertMethods(pi.CreateSubProgress(1.0));
}
示例10: CheckInternalState
///<summary>
///
/// Request to check all internal structures to make sure everything is fine after user edited text
///
///</summary>
///
public bool CheckInternalState(IProgressIndicator progressIndicator)
{
progressIndicator.Start(1);
progressIndicator.Stop();
return true;
}