本文整理汇总了C#中WorkspaceItem类的典型用法代码示例。如果您正苦于以下问题:C# WorkspaceItem类的具体用法?C# WorkspaceItem怎么用?C# WorkspaceItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkspaceItem类属于命名空间,在下文中一共展示了WorkspaceItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: create_a_selected_workspace_item
public void create_a_selected_workspace_item()
{
var item = new WorkspaceItem("something", true);
item.Children[0].ShouldBeOfType<CheckBox>().IsChecked.ShouldEqual(true);
item.Selected.ShouldBeTrue();
}
示例2: GetService
public virtual object GetService (WorkspaceItem item, Type type)
{
if (type.IsInstanceOfType (this))
return this;
else
return GetNext (item).GetService (item, type);
}
示例3: ExportSolutionDialog
public ExportSolutionDialog(WorkspaceItem item, FileFormat selectedFormat)
{
this.Build();
labelNewFormat.Text = item.FileFormat.Name;
formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (item);
foreach (FileFormat format in formats)
comboFormat.AppendText (format.Name);
int sel = Array.IndexOf (formats, selectedFormat);
if (sel == -1) sel = 0;
comboFormat.Active = sel;
if (formats.Length < 2) {
table.Remove (newFormatLabel);
newFormatLabel.Destroy ();
newFormatLabel = null;
table.Remove (comboFormat);
comboFormat.Destroy ();
comboFormat = null;
}
//auto height
folderEntry.WidthRequest = 380;
Resize (1, 1);
folderEntry.Path = item.ItemDirectory;
UpdateControls ();
}
示例4: Initialize
public override void Initialize (OptionsDialog dialog, object dataObject)
{
base.Initialize (dialog, dataObject);
solutionItem = dataObject as SolutionEntityItem;
if (solutionItem != null)
workspaceItem = solutionItem.ParentSolution;
else
workspaceItem = dataObject as WorkspaceItem;
}
示例5: ProcessWorkspaceItems
string ProcessWorkspaceItems(WorkspaceItem[] items, ProcessWorkspaceItemDelegate process)
{
string result = String.Empty;
int i = 0;
int count = items.Length;
foreach (WorkspaceItem item in items)
{
UpdateResult(ref result, process(item, ++i, count));
}
return result;
}
示例6: should_expose_the_selected_value
public void should_expose_the_selected_value()
{
var item = new WorkspaceItem("something", false);
item.Selected.ShouldBeFalse();
item.Children[0].ShouldBeOfType<CheckBox>().IsChecked = true;
item.Selected.ShouldBeTrue();
item.Children[0].ShouldBeOfType<CheckBox>().IsChecked = false;
item.Selected.ShouldBeFalse();
}
示例7: PrintWorkspaceItem
string PrintWorkspaceItem(WorkspaceItem item, int counter, int count)
{
int indentLevelOrig = Debug.IndentLevel;
int indentLevel = Debug.IndentLevel;
Debug.IndentLevel = ++indentLevel;
Debug.WriteLine(item.ToString());
Debug.IndentLevel = ++indentLevel;
if (item.Descriptions != null)
{
int i = 1;
int length = item.Descriptions.Length;
Debug.WriteLine(String.Format("Descriptions[{0}]", length)); Logger.InfoFormat("Descriptions[{0}]", length);
Debug.IndentLevel = ++indentLevel;
foreach (WorkspaceItemDescription description in item.Descriptions)
{
Debug.WriteLine(String.Format("Description {0} of {1} => {2}", i, length, description));
Logger.InfoFormat("\tDescription {0} of {1} => {2}", i++, length, description);
}
Debug.IndentLevel = --indentLevel;
}
if (item.Children != null)
{
int i = 1;
int length = item.Children.Length;
Debug.WriteLine(String.Format("Children[{0}]", length)); Logger.InfoFormat("Children[{0}]", length);
Debug.IndentLevel = ++indentLevel;
foreach (WorkspaceItem child in item.Children)
{
Debug.WriteLine(String.Format("Child {0} of {1} => {2}", i, length, child));
Logger.InfoFormat("\tChild {0} of {1} => {2}", i++, length, child);
}
Debug.IndentLevel = --indentLevel;
}
if (item.Properties != null)
{
int i = 1;
int length = item.Properties.Length;
Debug.WriteLine(String.Format("Properties[{0}]", length)); Logger.InfoFormat("Properties[{0}]", length);
Debug.IndentLevel = ++indentLevel;
foreach (WorkspaceItemProperty property in item.Properties)
{
Debug.WriteLine(String.Format("Property {0} of {1} => {2}", i, length, property));
Logger.InfoFormat("\tProperty {0} of {1} => {2}", i++, length, property);
}
Debug.IndentLevel = --indentLevel;
}
Debug.IndentLevel = indentLevelOrig;
return String.Empty;
}
示例8: Export
public void Export (WorkspaceItem item)
{
Export (item, null);
}
示例9: InternalWriteWorkspaceItem
internal void InternalWriteWorkspaceItem (IProgressMonitor monitor, string file, WorkspaceItem item)
{
string newFile = WriteFile (monitor, file, item, item.FileFormat);
if (newFile != null)
item.FileName = newFile;
else
throw new InvalidOperationException ("FileFormat not provided for workspace item '" + item.Name + "'");
}
示例10: Load
public static void Load (WorkspaceItem item)
{
if (IncLoadCount (item) != 1)
return;
lock (databases) {
if (item is Workspace) {
Workspace ws = (Workspace) item;
foreach (WorkspaceItem it in ws.Items)
Load (it);
ws.ItemAdded += OnWorkspaceItemAdded;
ws.ItemRemoved += OnWorkspaceItemRemoved;
}
else if (item is Solution) {
Solution solution = (Solution) item;
foreach (Project project in solution.GetAllProjects ())
Load (project);
// Refresh the references of all projects. This is necessary because
// some project may have been loaded before the projects their reference,
// in which case those references are not properly registered.
foreach (Project project in solution.GetAllProjects ()) {
ProjectDom dom = GetProjectDom (project);
// referenced by main project - prevents the removal if a project is referenced one time inside the solution
// and the project that references it is reloaded.
dom.ReferenceCount++;
if (dom != null)
dom.UpdateReferences ();
}
solution.SolutionItemAdded += OnSolutionItemAdded;
solution.SolutionItemRemoved += OnSolutionItemRemoved;
}
}
}
示例11: GetUserTasksFilename
static FilePath GetUserTasksFilename (WorkspaceItem item)
{
FilePath combinePath = item.FileName.ParentDirectory;
return combinePath.Combine (item.FileName.FileNameWithoutExtension + ".usertasks");
}
示例12: GetNeedsBuilding
protected virtual bool GetNeedsBuilding (WorkspaceItem item, ConfigurationSelector configuration)
{
if (item is Solution)
return GetNeedsBuilding ((Solution) item, configuration);
return GetNext (item).GetNeedsBuilding ((IBuildTarget) item, configuration);
}
示例13: WorkspaceItemChangeEventArgs
public WorkspaceItemChangeEventArgs (WorkspaceItem item, bool reloading): base (item)
{
this.reloading = reloading;
}
示例14: WorkspaceItemEventArgs
public WorkspaceItemEventArgs (WorkspaceItem item)
{
this.item = item;
}
示例15: Unload
public static void Unload (WorkspaceItem item)
{
if (DecLoadCount (item) != 0)
return;
if (item is Workspace) {
Workspace ws = (Workspace) item;
foreach (WorkspaceItem it in ws.Items)
Unload (it);
ws.ItemAdded -= OnWorkspaceItemAdded;
ws.ItemRemoved -= OnWorkspaceItemRemoved;
}
else if (item is Solution) {
Solution solution = (Solution) item;
foreach (Project project in solution.GetAllProjects ())
Unload (project);
solution.SolutionItemAdded -= OnSolutionItemAdded;
solution.SolutionItemRemoved -= OnSolutionItemRemoved;
}
}