本文整理汇总了C#中WorkspaceObject类的典型用法代码示例。如果您正苦于以下问题:C# WorkspaceObject类的具体用法?C# WorkspaceObject怎么用?C# WorkspaceObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkspaceObject类属于命名空间,在下文中一共展示了WorkspaceObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomCommandWidget
public CustomCommandWidget (WorkspaceObject 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 SolutionFolderItem)
tagModel = ((SolutionFolderItem)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: SupportsObject
internal protected override bool SupportsObject (WorkspaceObject item)
{
var p = item as SolutionItem;
if (p == null)
return false;
return FlavorGuid == null || p.GetItemTypeGuids ().Any (id => id.Equals (FlavorGuid, StringComparison.OrdinalIgnoreCase));
}
示例3: VersionControlItem
public VersionControlItem (Repository repository, WorkspaceObject workspaceObject, FilePath path, bool isDirectory, VersionInfo versionInfo)
{
Path = path;
Repository = repository;
WorkspaceObject = workspaceObject;
IsDirectory = isDirectory;
this.versionInfo = versionInfo;
}
示例4: UnitTest
protected UnitTest (string name, WorkspaceObject ownerSolutionItem)
{
this.name = name;
this.ownerSolutionItem = ownerSolutionItem;
ownerSolutionEntityItem = ownerSolutionItem as SolutionItem;
if (ownerSolutionEntityItem != null)
ownerSolutionEntityItem.DefaultConfigurationChanged += OnConfugurationChanged;
}
示例5: HandleTreeSelectionChanged
void HandleTreeSelectionChanged (object sender, EventArgs e)
{
TreeIter it;
if (tree.Selection.GetSelected (out it))
currentSelection = (WorkspaceObject) store.GetValue (it, 2);
else
currentSelection = null;
if (SelectionChanged != null)
SelectionChanged (this, EventArgs.Empty);
}
示例6: CreateUnitTest
public UnitTest CreateUnitTest (WorkspaceObject entry)
{
var ext = entry.GetService<MonoMakefileProjectExtension> ();
if (ext != null) {
var project = (DotNetProject) entry;
if (ext.UnitTest != null)
return (UnitTest) ext.UnitTest;
string testFileBase = ext.GetTestFileBase ();
UnitTest testSuite = new MonoTestSuite (project, project.Name, testFileBase);
ext.UnitTest = testSuite;
return testSuite;
}
return null;
}
示例7: CreateUnitTest
public UnitTest CreateUnitTest (WorkspaceObject entry)
{
UnitTest test = null;
if (entry is DotNetProject)
test = NUnitProjectTestSuite.CreateTest ((DotNetProject)entry);
UnitTestGroup grp = test as UnitTestGroup;
if (grp != null && !grp.HasTests) {
test.Dispose ();
return null;
}
return test;
}
示例8: SupportsObject
internal protected override bool SupportsObject (WorkspaceObject item)
{
var s = item as SolutionItem;
if (s == null)
return false;
var res = FlavorGuid == null || s.GetItemTypeGuids ().Any (id => id.Equals (FlavorGuid, StringComparison.OrdinalIgnoreCase));
if (!res)
return false;
var p = item as DotNetProject;
if (p == null || LanguageName == null)
return true;
return LanguageName == p.LanguageName;
}
示例9: VersionControlItem
public VersionControlItem (Repository repository, WorkspaceObject workspaceObject, FilePath path, bool isDirectory, VersionInfo versionInfo)
{
Path = path;
Repository = repository;
WorkspaceObject = workspaceObject;
IsDirectory = isDirectory;
this.versionInfo = versionInfo;
var obj = workspaceObject;
while (obj != null) {
var p = obj as Project;
if (p != null)
ContainerProject = p;
obj = obj.ParentObject;
}
}
示例10: AddTask
public static void AddTask (string fileName, string message, int column, int line, TaskSeverity taskType, WorkspaceObject workspaceObject)
{
// HACK: Use a compiler error since we cannot add an error
// task otherwise (task type property is read-only and
// no constructors usable).
BuildError error = new BuildError ();
error.Column = column;
error.Line = line;
error.ErrorText = message;
error.FileName = fileName;
error.IsWarning = false;
//Task task = new Task(fileName, message, column, line);
TaskListEntry task = new TaskListEntry (error);
task.WorkspaceObject = workspaceObject;
task.Owner = ActiveEditor;
TaskService.Errors.Add(task);
}
示例11: CreateUnitTest
public UnitTest CreateUnitTest (WorkspaceObject 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);
UnitTestGroup grp = test as UnitTestGroup;
if (grp != null && !grp.HasTests) {
test.Dispose ();
return null;
}
return test;
}
示例12: Publish
public static bool Publish (WorkspaceObject entry, FilePath localPath, bool test)
{
if (test)
return VersionControlService.CheckVersionControlInstalled () && VersionControlService.GetRepository (entry) == null;
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 ();
dlg.Dispose ();
}
return true;
}
示例13: CreateUnitTest
public UnitTest CreateUnitTest (WorkspaceObject 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) {
test.Dispose ();
return null;
}
return test;
}
示例14: BelongsToItem
public bool BelongsToItem (WorkspaceObject item, bool checkHierarchy)
{
if (!checkHierarchy)
return item == parentObject;
WorkspaceObject cit = parentObject;
do {
if (cit == item)
return true;
if (cit is SolutionFolderItem) {
var sfi = (SolutionFolderItem) cit;
if (sfi.ParentFolder != null)
cit = sfi.ParentFolder;
else
cit = sfi.ParentSolution;
}
else if (cit is WorkspaceItem) {
cit = ((WorkspaceItem)cit).ParentWorkspace;
}
else
cit = null;
} while (cit != null);
return false;
}
示例15: TaskListEntry
public TaskListEntry (BuildError error, object owner)
{
parentObject = error.SourceTarget as WorkspaceObject;
file = error.FileName;
this.owner = owner;
description = error.ErrorText;
column = error.Column;
line = error.Line;
if (!string.IsNullOrEmpty (error.ErrorNumber))
description += " (" + error.ErrorNumber + ")";
if (error.IsWarning)
severity = error.ErrorNumber == "COMMENT" ? TaskSeverity.Information : TaskSeverity.Warning;
else
severity = TaskSeverity.Error;
priority = TaskPriority.Normal;
code = error.ErrorNumber;
category = error.Subcategory;
helpKeyword = error.HelpKeyword;
}