本文整理汇总了C#中IWorkspaceObject类的典型用法代码示例。如果您正苦于以下问题:C# IWorkspaceObject类的具体用法?C# IWorkspaceObject怎么用?C# IWorkspaceObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWorkspaceObject类属于命名空间,在下文中一共展示了IWorkspaceObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomCommandWidget
public CustomCommandWidget (IWorkspaceObject entry, CustomCommand cmd, ConfigurationSelector configSelector)
{
this.Build();
this.cmd = cmd;
if (cmd != null) {
updating = true;
comboType.RemoveText (0);
updating = false;
}
this.entry = entry;
UpdateControls ();
this.WidgetFlags |= Gtk.WidgetFlags.NoShowAll;
StringTagModelDescription tagModel;
if (entry is SolutionItem)
tagModel = ((SolutionItem)entry).GetStringTagModelDescription (configSelector);
else if (entry is WorkspaceItem)
tagModel = ((WorkspaceItem)entry).GetStringTagModelDescription ();
else
tagModel = new StringTagModelDescription ();
tagSelectorDirectory.TagModel = tagModel;
tagSelectorDirectory.TargetEntry = workingdirEntry;
tagSelectorCommand.TagModel = tagModel;
tagSelectorCommand.TargetEntry = entryCommand;
}
示例2: VersionControlItem
public VersionControlItem (Repository repository, IWorkspaceObject workspaceObject, FilePath path, bool isDirectory)
{
this.path = path;
this.repository = repository;
this.workspaceObject = workspaceObject;
this.isDirectory = isDirectory;
}
示例3: CustomCommandWidget
public CustomCommandWidget(IWorkspaceObject entry, CustomCommand cmd, ConfigurationSelector configSelector, CustomCommandType[] supportedTypes)
{
this.Build();
this.supportedTypes = supportedTypes;
this.cmd = cmd;
updating = true;
if (cmd == null)
comboType.AppendText (GettextCatalog.GetString ("(Select a project operation)"));
foreach (var ct in supportedTypes)
comboType.AppendText (commandNames [(int)ct]);
updating = false;
this.entry = entry;
UpdateControls ();
this.WidgetFlags |= Gtk.WidgetFlags.NoShowAll;
StringTagModelDescription tagModel;
if (entry is SolutionItem)
tagModel = ((SolutionItem)entry).GetStringTagModelDescription (configSelector);
else if (entry is WorkspaceItem)
tagModel = ((WorkspaceItem)entry).GetStringTagModelDescription ();
else
tagModel = new StringTagModelDescription ();
tagSelectorDirectory.TagModel = tagModel;
tagSelectorDirectory.TargetEntry = workingdirEntry;
tagSelectorCommand.TagModel = tagModel;
tagSelectorCommand.TargetEntry = entryCommand;
}
示例4: UnitTest
protected UnitTest (string name, IWorkspaceObject ownerSolutionItem)
{
this.name = name;
this.ownerSolutionItem = ownerSolutionItem;
ownerSolutionEntityItem = ownerSolutionItem as SolutionEntityItem;
if (ownerSolutionEntityItem != null)
ownerSolutionEntityItem.DefaultConfigurationChanged += OnConfugurationChanged;
}
示例5: VersionControlItem
public VersionControlItem (Repository repository, IWorkspaceObject workspaceObject, FilePath path, bool isDirectory, VersionInfo versionInfo)
{
Path = path;
Repository = repository;
WorkspaceObject = workspaceObject;
IsDirectory = isDirectory;
this.versionInfo = versionInfo;
}
示例6: Task
public Task (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, IWorkspaceObject parent, object owner)
{
this.file = file;
this.description = description;
this.column = column;
this.line = line;
this.severity = severity;
this.priority = priority;
this.owner = owner;
this.parentObject = parent;
}
示例7: CreateTest
public static UnitTest CreateTest (IWorkspaceObject entry)
{
var project = entry as DotNetProject;
if (project != null) {
foreach (var r in project.References) {
if (r.Reference == "xunit")
return new XUnitProjectTestSuite (project);
}
}
return null;
}
示例8: CreateUnitTest
public UnitTest CreateUnitTest (IWorkspaceObject entry)
{
UnitTest test = null;
if (entry is DotNetProject)
test = XUnitProjectTestSuite.CreateTest (entry);
UnitTestGroup group = test as UnitTestGroup;
if (group != null && !group.HasTests)
return null;
return test;
}
示例9: CreateTest
public static UnitTest CreateTest (IWorkspaceObject entry)
{
var project = entry as DotNetProject;
if (project != null) {
foreach (var r in project.References) {
if (r.Reference == "xunit") // xUnit.Net 1.x
return new XUnitProjectTestSuite (project);
if (r.Reference.StartsWith ("xunit.core")) // xUnit.Net 2.x
return new XUnitProjectTestSuite (project);
}
}
return null;
}
示例10: CreateUnitTest
public UnitTest CreateUnitTest (IWorkspaceObject entry)
{
if (entry is DotNetProject) {
DotNetProject project = (DotNetProject) entry;
MonoSolutionItemHandler handler = ProjectExtensionUtil.GetItemHandler (project) as MonoSolutionItemHandler;
if (handler != null) {
if (handler.UnitTest != null)
return (UnitTest) handler.UnitTest;
string testFileBase = handler.GetTestFileBase ();
UnitTest testSuite = new MonoTestSuite (project, project.Name, testFileBase);
handler.UnitTest = testSuite;
return testSuite;
}
}
return null;
}
示例11: ExportProjectDialog
public ExportProjectDialog (IWorkspaceObject entry, FileFormat selectedFormat)
{
this.Build();
FileFormat f = entry is WorkspaceItem ? ((WorkspaceItem)entry).FileFormat : ((SolutionEntityItem)entry).FileFormat;
labelNewFormat.Text = f.Name;
formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (entry);
foreach (FileFormat format in formats)
comboFormat.AppendText (format.Name);
int sel = Array.IndexOf (formats, selectedFormat);
if (sel == -1) sel = 0;
comboFormat.Active = sel;
folderEntry.Path = entry.ItemDirectory;
UpdateControls ();
}
示例12: Publish
public static bool Publish (IWorkspaceObject entry, FilePath localPath, bool test)
{
if (test)
return true;
if (!VersionControlService.CheckVersionControlInstalled ())
return false;
List<FilePath> files = new List<FilePath> ();
// Build the list of files to be checked in
string moduleName = entry.Name;
if (localPath == entry.BaseDirectory) {
GetFiles (files, entry);
} else if (entry is Project) {
foreach (ProjectFile file in ((Project)entry).Files.GetFilesInPath (localPath))
if (file.Subtype != Subtype.Directory)
files.Add (file.FilePath);
} else
return false;
if (files.Count == 0)
return false;
SelectRepositoryDialog dlg = new SelectRepositoryDialog (SelectRepositoryMode.Publish);
try {
dlg.ModuleName = moduleName;
dlg.Message = GettextCatalog.GetString ("Initial check-in of module {0}", moduleName);
do {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok && dlg.Repository != null) {
AlertButton publishButton = new AlertButton ("_Publish");
if (MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to publish the project?"), GettextCatalog.GetString ("The project will be published to the repository '{0}', module '{1}'.", dlg.Repository.Name, dlg.ModuleName), AlertButton.Cancel, publishButton) == publishButton) {
PublishWorker w = new PublishWorker (dlg.Repository, dlg.ModuleName, localPath, files.ToArray (), dlg.Message);
w.Start ();
break;
}
} else
break;
} while (true);
} finally {
dlg.Destroy ();
}
return true;
}
示例13: CreateUnitTest
public UnitTest CreateUnitTest (IWorkspaceObject entry)
{
UnitTest test = null;
if (entry is SolutionFolder)
test = SolutionFolderTestGroup.CreateTest ((SolutionFolder)entry);
if (entry is Solution)
test = SolutionFolderTestGroup.CreateTest (((Solution)entry).RootFolder);
if (entry is Workspace)
test = WorkspaceTestGroup.CreateTest ((Workspace)entry);
if (entry is DotNetProject)
test = NUnitProjectTestSuite.CreateTest ((DotNetProject)entry);
if (entry is NUnitAssemblyGroupProject)
test = ((NUnitAssemblyGroupProject)entry).RootTest;
UnitTestGroup grp = test as UnitTestGroup;
if (grp != null && !grp.HasTests)
return null;
return test;
}
示例14: GetAllFiles
private Core.FilePath[] GetAllFiles(IWorkspaceObject item)
{
var files = new List<Core.FilePath>();
if (item is Solution) {
var sln = (Solution)item;
files.Add(sln.FileName);
foreach (var childSolution in sln.GetAllSolutions())
if (childSolution != sln)
files.AddRange(GetAllFiles(childSolution));
foreach (var project in sln.GetAllProjects())
files.AddRange(GetAllFiles(project));
}
if (item is Project) {
var prj = (Project)item;
files.Add(prj.FileName);
foreach (var file in ((Project)item).Files)
files.Add(file.FilePath);
}
return files.ToArray();
}
示例15: Export
public void Export (IWorkspaceObject entry, FileFormat format)
{
ExportProjectDialog dlg = new ExportProjectDialog (entry, format);
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
using (IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (true)) {
string folder = dlg.TargetFolder;
string file = entry is WorkspaceItem ? ((WorkspaceItem)entry).FileName : ((SolutionEntityItem)entry).FileName;
Services.ProjectService.Export (mon, file, folder, dlg.Format);
}
}
} finally {
dlg.Destroy ();
}
}