本文整理汇总了C#中JadeCore类的典型用法代码示例。如果您正苦于以下问题:C# JadeCore类的具体用法?C# JadeCore怎么用?C# JadeCore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JadeCore类属于命名空间,在下文中一共展示了JadeCore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SearchResultsPaneViewModel
public SearchResultsPaneViewModel(JadeCore.Search.ISearchController controller)
{
Title = "Search Results";
ContentId = "SearchResultsToolPane";
_controller = controller;
_searches = new ObservableCollection<SearchViewModel>();
((INotifyCollectionChanged)_controller.Searches).CollectionChanged +=
delegate(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
OnNewSearch((ISearch)e.NewItems[0]);
}
};
_currentFileTextSearch = new CurrentFileTextSearchViewModel(_controller);
JadeCore.Services.Provider.EditorController.ActiveDocumentChanged += delegate { OnPropertyChanged("CanPerformSearchInCurrentFile"); };
JadeCore.Services.Provider.MainWindow.CommandBindings.Add(new CommandBinding(JadeCore.Commands.SearchCurrentFile,
delegate(object target, ExecutedRoutedEventArgs args)
{
RaiseStartNewCurrentFileSearch();
args.Handled = true;
},
delegate(object target, CanExecuteRoutedEventArgs args)
{
args.CanExecute = CanPerformSearchInCurrentFile;
args.Handled = true;
}));
}
示例2: MakeFolder
static private FolderType MakeFolder(JadeCore.Workspace.IFolder folder, string workspaceDir)
{
FolderType result = new FolderType();
result.Name = folder.Name;
FolderType[] subs = new FolderType[folder.Folders.Count];
for (int i = 0; i < folder.Folders.Count; i++)
{
subs[i] = MakeFolder(folder.Folders[i], workspaceDir);
}
result.Folders = subs;
List<JadeCore.Workspace.ProjectItem> projTemps = new List<JadeCore.Workspace.ProjectItem>();
foreach (JadeCore.Workspace.ProjectItem proj in folder.Items.OfType<JadeCore.Workspace.ProjectItem>())
{
projTemps.Add(proj);
}
ProjectType[] projs = new ProjectType[projTemps.Count];
for(int i=0;i<projTemps.Count;i++)
{
projs[i] = MakeProject(projTemps[i], workspaceDir);
}
result.Projects = projs;
return result;
}
示例3: MakeFile
static private FileType MakeFile(JadeCore.Project.FileItem file, string projectDir)
{
FileType result = new FileType();
//Convert to relative path for storage in workspace
result.Path = JadeUtils.IO.PathUtils.CalculateRelativePath(projectDir + @"\", file.Path.Str);
return result;
}
示例4: SearchResultItemViewModel
public SearchResultItemViewModel(JadeCore.Search.ISearchResult result)
{
_result = result;
StringBuilder sb = new StringBuilder();
sb.Append(result.Location.Path.Str);
sb.Append(" - ");
JadeCore.ITextDocument doc = JadeCore.Services.Provider.WorkspaceController.DocumentCache.FindOrAdd(result.File);
_file = doc.File;
LineNum = doc.GetLineNumForOffset(result.Location.Offset);
ISegment line = doc.GetLineForOffset(result.Location.Offset);
if(line != null)
{
int column = result.Location.Offset - line.Offset + 1;
sb.Append("(");
sb.Append(LineNum);
sb.Append(",");
sb.Append(column);
sb.Append(")");
sb.Append(": ");
sb.Append(doc.GetText(line).Trim());
}
_summary = sb.ToString();
}
示例5: Highlighter
public Highlighter(JadeCore.ITextDocument doc)
{
if (doc == null)
throw new ArgumentNullException("doc");
_document = doc;
_highlights = new TextSegmentCollection<HighlightedRange>();
_textViews = new List<TextView>();
}
示例6: MakeProject
static private ProjectType MakeProject(JadeCore.Workspace.ProjectItem proj, string workspaceDir)
{
ProjectType result = new ProjectType();
//Convert to relative path for storage in workspace
result.Path = JadeUtils.IO.PathUtils.CalculateRelativePath(workspaceDir + @"\", proj.Path.Str);
Persistence.Project.Writer.Write(proj, proj.Path.Str);
return result;
}
示例7: EditorControlViewModel
public EditorControlViewModel(JadeCore.IEditorController controller, IDocumentViewModelFactory docViewModelFactory)
{
//Bind to the Model
_controller = controller;
_controller.ActiveDocumentChanged += OnControllerActiveDocumentChanged;
_controller.DocumentClosed += OnControllerDocumentClosed;
_documents = new ObservableCollection<DocumentViewModel>();
_docViewModelFactory = docViewModelFactory;
}
示例8: OutputViewModel
public OutputViewModel(JadeCore.Output.IOutputController controller)
{
Title = "Output";
ContentId = "OutputToolPane";
_Controller = controller;
_Items = new JadeCore.Collections.ObservableCollectionTransform<JadeCore.Output.IItem, OutputItemViewModel>(_Controller.Items,
delegate (JadeCore.Output.IItem i){ return new OutputItemViewModel(i); });
_Items.CollectionChanged += ItemsCollectionChanged;
_sb = new StringBuilder();
}
示例9: ContextPaneViewModel
public ContextPaneViewModel(JadeCore.IEditorController editCtrl)
{
Title = "Context Tool";
ContentId = "ContextToolPane";
_editorController = editCtrl;
_root = new ObservableCollection<DeclarationViewModel>();
_files = new HashSet<FilePath>();
JadeCore.Services.Provider.CppParser.TranslationUnitIndexed += OnCppParserTranslationUnitIndexed;
}
示例10: FindProjectFolder
/*
1) Find the Folder definitions
<Filter Include="Source">
<UniqueIdentifier>{1a2da8c0-5f2c-4e2e-bd3f-3c94e4c7925b}</UniqueIdentifier>
</Filter>
2) then look for source files
<ClCompile Include="..\test.cpp">
<Filter>Source</Filter>
</ClCompile>
3) then look for headers
<ClInclude Include="..\template.h">
<Filter>Header Files</Filter>
</ClInclude>
*/
private JadeCore.Project.IFolder FindProjectFolder(JadeCore.Project.IFolder parent, string path)
{
string[] parts = path.Split('\\');
if (parts.Length == 0) return null;
JadeCore.Project.IFolder result = parent;
foreach (string name in parts)
{
result = result.FindFolder(name);
if (result == null)
return null;
}
return result;
}
示例11: GetLevelText
private string GetLevelText(JadeCore.Output.Level level)
{
switch (level)
{
case(JadeCore.Output.Level.Crit):
return "Critical: ";
case (JadeCore.Output.Level.Err):
return "Error: ";
case (JadeCore.Output.Level.Info):
return "Information: ";
case (JadeCore.Output.Level.Warn):
return "Warning: ";
}
throw new InvalidOperationException("Bad Level");
}
示例12: MakeFolder
private static JadeCore.Project.IFolder MakeFolder(JadeCore.Project.IProject project, string projectDir, FolderType xml, IFileService fileService)
{
JadeCore.Project.Folder folder = new JadeCore.Project.Folder(project, xml.Name);
foreach (FileType f in xml.Files)
{
project.AddItem(folder, MakeFile(projectDir, f, fileService));
//folder.AddItem(MakeFile(projectDir, f, fileService));
}
foreach (FolderType f in xml.Folders)
{
folder.AddFolder(MakeFolder(project, projectDir, f, fileService));
}
return folder;
}
示例13: WorkspaceFolder
public WorkspaceFolder(TreeNodeBase parent, JadeCore.Workspace.IFolder data)
: base(data.Name, parent)
{
_data = data;
foreach (JadeCore.Workspace.IFolder f in _data.Folders)
{
WorkspaceFolder folder = new WorkspaceFolder(this, f);
AddChildFolder(f);
}
foreach (JadeCore.Workspace.IItem item in _data.Items)
{
if (item is JadeCore.Project.IProject)
{
AddChildProject(item as JadeCore.Project.IProject);
}
}
}
示例14: ProjectFolder
public ProjectFolder(TreeNodeBase parent, JadeCore.Project.IFolder data)
: base(data.Name, parent)
{
_data = data;
foreach (JadeCore.Project.IFolder f in _data.Folders)
{
AddChildFolder(new ProjectFolder(this, f));
}
foreach (JadeCore.Project.IItem i in _data.Items)
{
if (i is JadeCore.Project.FileItem)
{
AddChildFile(new File(this, i as JadeCore.Project.FileItem));
}
}
}
示例15: FindFileItem
private IFileItem FindFileItem(JadeCore.Project.IFolder folder, FilePath path)
{
foreach(IItem item in folder.Items)
{
if(item is FileItem)
{
if ((item as FileItem).Path == path)
return item as FileItem;
}
}
foreach(IFolder child in folder.Folders)
{
IFileItem result = FindFileItem(child, path);
if (result != null)
return result;
}
return null;
}