本文整理汇总了C#中MonoDevelop类的典型用法代码示例。如果您正苦于以下问题:C# MonoDevelop类的具体用法?C# MonoDevelop怎么用?C# MonoDevelop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MonoDevelop类属于命名空间,在下文中一共展示了MonoDevelop类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Format
public static void Format (MonoDevelop.Ide.Gui.Document data, ProjectDom dom, DomLocation location, bool correctBlankLines, bool runAferCR = false)
{
PolicyContainer policyParent = dom != null && dom.Project != null ? dom.Project.Policies
: PolicyService.DefaultPolicies;
var mimeTypeChain = DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
Format (policyParent, mimeTypeChain, data, dom, location, correctBlankLines, runAferCR);
}
开发者ID:sandyarmstrong,项目名称:monodevelop,代码行数:7,代码来源:OnTheFlyFormatter.cs
示例2: GetResolveResult
public static ResolveResult GetResolveResult (MonoDevelop.Ide.Gui.Document doc)
{
ITextEditorResolver textEditorResolver = doc.GetContent<ITextEditorResolver> ();
if (textEditorResolver != null)
return textEditorResolver.GetLanguageItem (doc.Editor.Caret.Offset);
return null;
}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:7,代码来源:RefactoryCommands.cs
示例3: OnBuild
protected override BuildResult OnBuild (MonoDevelop.Core.IProgressMonitor monitor, ConfigurationSelector configuration)
{
var restResult = RestClient.CompileScripts ();
var result = new BuildResult ();
foreach (var message in restResult.Messages)
{
var file = BaseDirectory + "/" + message.File;
var msg = message.Message;
var errorNum = "";
var messageStrings = message.Message.Split(':');
if (messageStrings.Length == 3)
{
var errorNumStrings = messageStrings[1].Split(' ');
if (errorNumStrings.Length > 1)
errorNum = errorNumStrings[errorNumStrings.Length - 1];
msg = messageStrings[2];
}
if(message.Type == "warning")
result.AddWarning(file, message.Line, message.Column, errorNum, msg);
else
result.AddError(file, message.Line, message.Column, errorNum, msg);
}
return result;
}
开发者ID:0xb1dd1e,项目名称:MonoDevelop.UnityMode,代码行数:31,代码来源:UnitySolution.cs
示例4: StyledSourceEditorOptions
public StyledSourceEditorOptions (MonoDevelop.Ide.Editor.ITextEditorOptions optionsCore)
{
if (optionsCore == null)
throw new ArgumentNullException ("optionsCore");
this.optionsCore = optionsCore;
DefaultSourceEditorOptions.Instance.Changed += HandleChanged;
}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:7,代码来源:StyledSourceEditorOptions.cs
示例5: HandleCompletion
public Task<ICompletionDataList> HandleCompletion (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, CodeCompletionContext completionContext,
UnderlyingDocumentInfo docInfo, char currentChar, CancellationToken token)
{
CodeCompletionContext ccc;
var completion = CreateCompletionAndUpdate (editor, context, docInfo, out ccc);
return completion.HandleCodeCompletionAsync (completionContext, currentChar, token);
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:RazorCSharpCompletionBuilder.cs
示例6: AnalyzeTargetExpression
bool AnalyzeTargetExpression (RefactoringOptions options, MonoDevelop.CSharp.Ast.CompilationUnit unit)
{
var data = options.GetTextEditorData ();
var target = unit.GetNodeAt (data.Caret.Line, data.Caret.Column);
if (target == null)
return false;
if (target.Parent is MemberReferenceExpression && ((MemberReferenceExpression)target.Parent).GetChildByRole (MemberReferenceExpression.Roles.Identifier) == target) {
var memberReference = (MemberReferenceExpression)target.Parent;
target = memberReference.Target;
var targetResult = options.GetResolver ().Resolve (new ExpressionResult (data.GetTextBetween (target.StartLocation.Line, target.StartLocation.Column, target.EndLocation.Line, target.EndLocation.Column)), resolvePosition);
if (targetResult.StaticResolve)
modifiers = MonoDevelop.Projects.Dom.Modifiers.Static;
declaringType = options.Dom.GetType (targetResult.ResolvedType);
methodName = memberReference.MemberName;
} else if (target is Identifier) {
declaringType = options.ResolveResult.CallingType;
methodName = data.GetTextBetween (target.StartLocation.Line, target.StartLocation.Column, target.EndLocation.Line, target.EndLocation.Column);
}
if (declaringType != null && !HasCompatibleMethod (declaringType, methodName, invocation)) {
if (declaringType.HasParts)
declaringType = declaringType.Parts.FirstOrDefault (t => t.CompilationUnit.FileName == options.Document.FileName) ?? declaringType;
var doc = ProjectDomService.GetParsedDocument (declaringType.SourceProjectDom, declaringType.CompilationUnit.FileName);
declaringType = doc.CompilationUnit.GetTypeAt (declaringType.Location) ?? declaringType;
return true;
}
return false;
}
开发者ID:okrmartin,项目名称:monodevelop,代码行数:28,代码来源:CreateMethodCodeGenerator.cs
示例7: FindReferences
public override IEnumerable<MemberReference> FindReferences (MonoDevelop.Projects.Project project, IProjectContent content, IEnumerable<FilePath> files, IProgressMonitor monitor, IEnumerable<object> searchedMembers)
{ // TODO: Type system conversion.
yield break;
// var editor = TextFileProvider.Instance.GetTextEditorData (fileName);
// AspNetAppProject project = dom.Project as AspNetAppProject;
// if (project == null)
// yield break;
//
// var unit = AspNetParserService.GetCompileUnit (project, fileName, true);
// if (unit == null)
// yield break;
// var refman = new DocumentReferenceManager (project);
//
// var parsedAspDocument = (AspNetParsedDocument)new AspNetParser ().Parse (dom, fileName, editor.Text);
// refman.Doc = parsedAspDocument;
//
// var usings = refman.GetUsings ();
// var documentInfo = new DocumentInfo (dom, unit, usings, refman.GetDoms ());
//
// var builder = new AspLanguageBuilder ();
//
//
// var buildDocument = new Mono.TextEditor.TextDocument ();
// var offsetInfos = new List<LocalDocumentInfo.OffsetInfo> ();
// buildDocument.Text = builder.BuildDocumentString (documentInfo, editor, offsetInfos, true);
// var parsedDocument = AspLanguageBuilder.Parse (dom, fileName, buildDocument.Text);
// foreach (var member in searchedMembers) {
// foreach (var reference in SearchMember (member, dom, fileName, editor, buildDocument, offsetInfos, parsedDocument)) {
// yield return reference;
// }
// }
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:32,代码来源:ASPNetReferenceFinder.cs
示例8: JumpToDeclaration
public static void JumpToDeclaration (MonoDevelop.Ide.Gui.Document doc, RefactoringSymbolInfo info)
{
if (info.Symbol != null)
RefactoringService.RoslynJumpToDeclaration (info.Symbol, doc.Project);
if (info.CandidateSymbols.Length > 0)
RefactoringService.RoslynJumpToDeclaration (info.CandidateSymbols[0], doc.Project);
}
开发者ID:hbons,项目名称:monodevelop,代码行数:7,代码来源:GotoDeclarationHandler.cs
示例9: Compile
protected override BuildResult Compile(MonoDevelop.Core.IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData)
{
#if DEBUG
monitor.Log.WriteLine("MonoGame Extension Compile Called");
#endif
try
{
var proj = item as MonoGameProject;
if (proj == null)
{
return base.Compile (monitor, item, buildData);
}
monitor.Log.WriteLine("Compiling for {0}", proj.MonoGamePlatform);
var results = new System.Collections.Generic.List<BuildResult>();
foreach(var file in proj.Files)
{
if (MonoGameBuildAction.IsMonoGameBuildAction(file.BuildAction))
{
buildData.Items.Add(file);
var buildResult = MonoGameContentProcessor.Compile(file, monitor, buildData);
results.Add(buildResult);
}
}
return base.Compile (monitor, item, buildData).Append(results);
}
finally
{
#if DEBUG
monitor.Log.WriteLine("MonoGame Extension Compile Ended");
#endif
}
}
开发者ID:dellis1972,项目名称:MonoGameMonoDevelopAddin,代码行数:32,代码来源:MonoGameProject.cs
示例10: Compile
protected override BuildResult Compile (MonoDevelop.Core.IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData)
{
var proj = item as Project;
if (proj == null)
return base.Compile (monitor, item, buildData);
if (!proj.GetProjectTypes().Any(x => supportedProjectTypes.ContainsKey(x)))
return base.Compile (monitor, item, buildData);
var files = buildData.Items.Where(x => x is ProjectFile).Cast<ProjectFile>().ToArray();
foreach (var file in files.Where(f => f.BuildAction == "MonoGameContentReference")) {
var path = System.IO.Path.Combine (Path.GetDirectoryName (file.FilePath.ToString ()), "bin", supportedProjectTypes[platform]);
monitor.Log.WriteLine("Processing {0}", path);
if (!Directory.Exists (path))
continue;
foreach (var output in Directory.GetFiles (path, "*.*", SearchOption.AllDirectories)) {
var link = string.Format ("Content{0}", output.Replace (path, ""));
if (proj.Files.FirstOrDefault (x => Path.GetFileName (x.FilePath.ToString ()) == Path.GetFileName (output)) == null) {
monitor.Log.WriteLine ("Auto Including Content {0}", output);
proj.Files.Add (new ProjectFile (output, BuildAction.BundleResource) {
Link = new MonoDevelop.Core.FilePath (link),
Flags = ProjectItemFlags.DontPersist | ProjectItemFlags.Hidden,
Visible = false,
});
}
}
}
return base.Compile (monitor, item, buildData);
}
开发者ID:Cardanis,项目名称:MonoGame,代码行数:27,代码来源:MonoGameBuildExtension.cs
示例11: CommonTextEditorOptions
CommonTextEditorOptions (MonoDevelop.Ide.Gui.Content.TextStylePolicy currentPolicy)
{
UpdateStylePolicy (currentPolicy);
MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.Changed += delegate(object sender, EventArgs e) {
OnChanged (e);
};
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:CommonTextEditorOptions.cs
示例12: GetFixes
//FIXME: why is this invalid on the parseddocuments loaded when the doc is first loaded?
//maybe the item's type's SourceProject is null?
public IEnumerable<IAnalysisFixAction> GetFixes (MonoDevelop.Ide.Gui.Document doc, object fix)
{
var renameFix = (RenameMemberFix) fix;
var refactoring = new RenameRefactoring ();
var options = new RefactoringOptions () {
Document = doc,
Dom = doc.Dom,
SelectedItem = renameFix.Item,
};
if (!refactoring.IsValid (options))
yield break;
var prop = new RenameRefactoring.RenameProperties () {
NewName = renameFix.NewName,
};
yield return new RenameFixAction () {
Label = GettextCatalog.GetString ("Rename '{0}' to '{1}'", renameFix.Item.Name, renameFix.NewName),
Refactoring = refactoring,
Options = options,
Properties = prop,
Preview = false,
};
yield return new RenameFixAction () {
Label = GettextCatalog.GetString ("Rename '{0}' to '{1}' with preview",
renameFix.Item.Name, renameFix.NewName),
Refactoring = refactoring,
Options = options,
Properties = prop,
Preview = true,
};
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:35,代码来源:RenameMemberFix.cs
示例13: GetActions
public override IEnumerable<MonoDevelop.CodeActions.CodeAction> GetActions (MonoDevelop.Ide.Gui.Document document, object refactoringContext, TextLocation loc, CancellationToken cancellationToken)
{
var context = refactoringContext as MDRefactoringContext;
if (context == null)
return Enumerable.Empty<MonoDevelop.CodeActions.CodeAction> ();
return GetActions (context);
}
开发者ID:fedorw,项目名称:monodevelop,代码行数:7,代码来源:MoveTypeToFile.cs
示例14: ProgressDialog
public ProgressDialog (MonoDevelop.Components.Window parent, bool allowCancel, bool showDetails)
{
MonoDevelop.Components.IdeTheme.ApplyTheme (this);
this.Build ();
this.Title = BrandingService.ApplicationName;
HasSeparator = false;
ActionArea.Hide ();
DefaultHeight = 5;
TransientFor = parent;
btnCancel.Visible = allowCancel;
expander.Visible = showDetails;
buffer = detailsTextView.Buffer;
detailsTextView.Editable = false;
bold = new TextTag ("bold");
bold.Weight = Pango.Weight.Bold;
buffer.TagTable.Add (bold);
tag = new TextTag ("0");
tag.Indent = 10;
buffer.TagTable.Add (tag);
tags.Add (tag);
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:27,代码来源:ProgressDialog.cs
示例15: SupportsFramework
public override bool SupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
{
if (!framework.IsCompatibleWithFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_4_0))
return false;
else
return base.SupportsFramework (framework);
}
开发者ID:jschieck,项目名称:MonoGame-2.5.1.0-0,代码行数:7,代码来源:MonoGameProject.cs
示例16: GetLanguageItem
public ISymbol GetLanguageItem (MonoDevelop.Ide.Gui.Document document, int offset, string identifier)
{
if (document.ParsedDocument == null)
return null;
var model = document.ParsedDocument.GetAst<SemanticModel> ();
if (model == null)
return null;
int index = identifier.IndexOf ("`", System.StringComparison.Ordinal);
int arity = 0;
if (index != -1) {
arity = int.Parse (identifier.Substring (index + 1));
identifier = identifier.Remove (index);
}
foreach (var symbol in model.LookupSymbols (offset, name: identifier)) {
var typeSymbol = symbol as INamedTypeSymbol;
if (typeSymbol != null && (arity == 0 || arity == typeSymbol.Arity)) {
return symbol;
}
var namespaceSymbol = symbol as INamespaceSymbol;
if (namespaceSymbol != null) {
return namespaceSymbol;
}
}
return null;
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:27,代码来源:TextEditorResolverProvider.cs
示例17: Update
protected override void Update(MonoDevelop.Components.Commands.CommandInfo info)
{
var possibleTasks = provider.GetPossibleRefactoring();
validTasks = possibleTasks.Where(t=>t.IsValid());
info.Enabled = validTasks.Any();
}
开发者ID:nieve,项目名称:Stereo,代码行数:7,代码来源:QuickFixesHandler.cs
示例18: ModifyTags
public override void ModifyTags(
MonoDevelop.Projects.SolutionItem policyParent,
MonoDevelop.Projects.Project project,
string language,
string identifier,
string fileName,
ref Dictionary<string, string> tags)
{
base.ModifyTags(policyParent, project, language, identifier, fileName, ref tags);
const string ModuleNameTag = "ModuleName";
if (tags != null) {
var dprj = project as AbstractDProject;
if (dprj != null) {
if(fileName != null)
foreach (var basePath in dprj.GetSourcePaths()) {
var bp = System.IO.Path.GetFullPath (basePath);
if (fileName.StartsWith (bp)) {
tags [ModuleNameTag] = DModule.GetModuleName (bp, fileName);
break;
}
}
}
if(!tags.ContainsKey(ModuleNameTag))
tags [ModuleNameTag] = DModule.GetModuleName (project == null ? string.Empty : project.BaseDirectory.ToString (), fileName ?? identifier ?? string.Empty).Replace (' ', '_');
}
}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:27,代码来源:DFileDescriptionTemplate.cs
示例19: Execute
public override bool Execute (MonoDevelop.Projects.SolutionItem solutionItem, out string message)
{
message = "";
var project = solutionItem as Project;
var outputPath = project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration);
string mpackOutputFolder = outputPath.ParentDirectory;
using (var scope = base.TaskScope("Deleting mpack files..."))
{
foreach (var f in Directory.GetFiles (mpackOutputFolder, "*" + MDToolHelper.MPACK_FILE_EXTENSION))
{
File.Delete (f);
}
}
using (var scope = base.TaskScope ("Deleting mrep files..."))
{
foreach (var f in Directory.GetFiles (mpackOutputFolder, "*" + MDToolHelper.MREP_FILE_EXTENSION))
{
File.Delete (f);
}
}
CommandStatus ("Done!");
return true;
}
开发者ID:interisti,项目名称:monodevelop-addin-packager,代码行数:29,代码来源:CleanAddinPackageHandler.cs
示例20: PushChar
public override State PushChar (char c, MonoDevelop.Xml.StateEngine.IParseContext context, ref string rollback)
{
//NOTE: This is (mostly) duplicated in HtmlTagState
//handle inline tags implicitly closed by block-level elements
if (context.CurrentStateLength == 1 && context.PreviousState is XmlNameState)
{
XClosingTag ct = (XClosingTag) context.Nodes.Peek ();
if (!ct.Name.HasPrefix && ct.Name.IsValid) {
//Note: the node stack will always be at least 1 deep due to the XDocument
var parent = context.Nodes.Peek (1) as XElement;
//if it's not a matching closing tag
if (!string.Equals (ct.Name.Name, parent.Name.Name, StringComparison.OrdinalIgnoreCase)) {
//attempt to implicitly close the parents
while (parent.ValidAndNoPrefix () && parent.IsImplicitlyClosedBy (ct)) {
context.Nodes.Pop ();
context.Nodes.Pop ();
if (warnAutoClose) {
context.LogWarning (string.Format ("Tag '{0}' implicitly closed by closing tag '{1}'.",
parent.Name.Name, ct.Name.Name), parent.Region);
}
//parent.Region.End = element.Region.Start;
//parent.Region.EndColumn = Math.Max (parent.Region.EndColumn - 1, 1);
parent.Close (parent);
context.Nodes.Push (ct);
parent = context.Nodes.Peek (1) as XElement;
}
}
}
}
return base.PushChar (c, context, ref rollback);
}
开发者ID:harishamdani,项目名称:monodevelop,代码行数:33,代码来源:HtmlClosingTagState.cs
注:本文中的MonoDevelop类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论