本文整理汇总了C#中ProjectElement类的典型用法代码示例。如果您正苦于以下问题:C# ProjectElement类的具体用法?C# ProjectElement怎么用?C# ProjectElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectElement类属于命名空间,在下文中一共展示了ProjectElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LoadTable
private void LoadTable()
{
var imageCount = Data.Database.Main.Table<ProjectImage>().Count();
var allPatternsButton = new StyledElement("All UI Images", imageCount.ToString(), UITableViewCellStyle.Value1);
if (imageCount > 0)
{
allPatternsButton.Accessory = UITableViewCellAccessory.DisclosureIndicator;
allPatternsButton.Tapped += () => NavigationController.PushViewController(new LocalViewPatternsViewController() { Title = "All" }, true);
}
var section = new Section("Albums");
var projects = Data.Database.Main.Table<Project>();
foreach (var p in projects)
{
var project = p;
var element = new ProjectElement(project);
if (Data.Database.Main.Table<ProjectImage>().Where(a => a.ProjectId == project.Id).Count() > 0)
{
element.Accessory = UITableViewCellAccessory.DisclosureIndicator;
element.Tapped += () => {
NavigationController.PushViewController(new LocalViewPatternsViewController(project.Id) { Title = project.Name }, true);
};
}
section.Add(element);
}
var root = new RootElement(Title) { new Section() { allPatternsButton }, section };
Root = root;
}
开发者ID:GSerjo,项目名称:appreciateui,代码行数:29,代码来源:AlbumsViewController.cs
示例2: OnBindToElement
private void OnBindToElement(object sender, BindToElementEventArgs e)
{
if (e.Element == null || !(e.Element is ProjectElement)) return;
Element = e.Element as ProjectElement;
this.DataContext = Element;
}
开发者ID:taliesins,项目名称:talifun-commander,代码行数:7,代码来源:ProjectElementPanel.xaml.cs
示例3: ExpectedNamespace
private string ExpectedNamespace(ProjectElement project, string documentPath)
{
var projectpath = Path.GetDirectoryName(project.FilePath);
var filepath = Path.GetDirectoryName(documentPath);
var namespaceSuffix = projectpath.Length < filepath.Length ? filepath.Substring(projectpath.Length).Replace("\\", ".") : String.Empty;
return GetDefaultNamespace(project) + namespaceSuffix;
}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:7,代码来源:Refactor_UpdateNamespacePlugIn.cs
示例4: MVSSolutionFile
public MVSSolutionFile(StreamReader data)
{
data.ReadLine();
var Header = data.ReadLine();
var Project = data.ReadLine();
while (Project != null)
{
if (Project.StartsWith("Project"))
{
var r = ToValueReader(Project);
var p = new ProjectElement
{
Kind = r(0),
Name = r(1),
ProjectFile = r(2),
Identifier = r(3),
};
this.Projects.Add(p);
}
Project = data.ReadLine();
}
}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:27,代码来源:MVSSolutionFile.cs
示例5: CreateDependentFileNode
/// <summary>
/// Create dependent file node based on an msbuild item
/// </summary>
/// <param name="item">msbuild item</param>
/// <returns>dependent file node</returns>
public virtual FileNode CreateDependentFileNode(ProjectElement item)
{
// заменил возвращаемый тип с DependentFileNode на FileNode
// для поддержки наследования NemerleDependentFileNode -> NemerleFileNode
return new DependentFileNode(this, item);
}
开发者ID:vestild,项目名称:nemerle,代码行数:12,代码来源:ProjectNode.CreateDependentFileNode.cs
示例6: LoadImportedNamespaces
protected virtual void LoadImportedNamespaces(ProjectElement project, XmlDocument doc, string projectDir, string projectLangTag)
{
string lImportsQuery = String.Format(STR_ImportsQueryFormat, projectLangTag);
XmlNodeList lImports = doc.SelectNodes(lImportsQuery);
int lCount = lImports.Count;
for (int i = 0; i < lCount; i++)
{
System.Xml.XmlNode lImportNode = lImports[i];
System.Xml.XmlNode lNamespace = lImportNode.Attributes.GetNamedItem(STR_Namespace);
string lNamespaceStr = lNamespace.Value;
project.AddImportedNamespace(lNamespaceStr);
}
}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:13,代码来源:ProjectLoaderBase.cs
示例7: LoadReferences
protected virtual void LoadReferences(ProjectElement project, Hashtable projects, XmlDocument doc, string projectDir, string projectLangTag)
{
string lReferencesQuery = String.Format(STR_ReferencesQueryFormat, projectLangTag);
XmlNodeList lReferences = doc.SelectNodes(lReferencesQuery);
int lCount = lReferences.Count;
for (int i = 0; i < lCount; i++)
{
System.Xml.XmlNode lReferenceNode = lReferences[i];
System.Xml.XmlNode lName = lReferenceNode.Attributes.GetNamedItem(STR_Name);
System.Xml.XmlNode lAssemblyName = lReferenceNode.Attributes.GetNamedItem(STR_AssemblyName);
if (lAssemblyName != null)
{
string lAssemblyNameStr = lAssemblyName.Value;
string lPath = FrameworkHelper.GetAssemblyPath(lAssemblyNameStr);
if (lPath == null || lPath.Length == 0)
{
System.Xml.XmlNode lHintPath = lReferenceNode.Attributes.GetNamedItem("HintPath");
lPath = lHintPath.Value;
lPath = PathUtilities.GetPath(projectDir, lPath);
if (File.Exists(lPath))
{
AssemblyReference lRef = new AssemblyReference(lPath);
project.AddReference(lRef);
}
}
else
project.AddReferenceByName(lAssemblyNameStr);
}
else
{
System.Xml.XmlNode lProjectRef = lReferenceNode.Attributes.GetNamedItem(STR_Project);
string lGuid = lProjectRef.Value;
ProjectInfo lInfo = projects[lGuid] as ProjectInfo;
if (lInfo != null)
{
AssemblyReference lRef = new AssemblyReference(String.Empty);
lRef.SetSourceProjectFullName(lInfo.FilePath);
project.AddReference(lRef);
}
}
}
}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:42,代码来源:ProjectLoaderBase.cs
示例8: LoadCompileUnits
protected virtual void LoadCompileUnits(ProjectElement project, XmlDocument lDoc, string lProjectDir, string lProjectLangTag)
{
}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:3,代码来源:ProjectLoaderBase.cs
示例9: LoadRootNamespace
protected override void LoadRootNamespace(ProjectElement project, XmlDocument lDoc, string lProjectDir, string lProjectLangTag)
{
base.LoadRootNamespace(project, lDoc, lProjectDir, lProjectLangTag);
}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:4,代码来源:ProjectLoaderBase.cs
示例10: CreateMenu
/// <summary>
/// Invoked when it comes time to set the root
/// </summary>
private void CreateMenu()
{
var root = new RootElement(Title);
root.Add(new Section() {
new MenuElement("Add Pattern", () => OpenAddPatternView(), Images.Menu.Plus)
});
var browseSection = new Section() { HeaderView = new MenuSectionView("Browse") };
root.Add(browseSection);
browseSection.Add(new MenuElement("Recently Added", () => {
var c = new RecentPatternsViewController();
NavigationController.PushViewController(c, true);
}, Images.Menu.Recent));
browseSection.Add(new MenuElement("UI Patterns", () => {
var c = new PatternCategoriesViewController();
NavigationController.PushViewController(c, true);
}, Images.Menu.UIPatterns));
browseSection.Add(new MenuElement("Icons", () => {
var c = new IconBrowserController();
NavigationController.PushViewController(c, true);
}, Images.Menu.Icons));
var albumSection = new Section() { HeaderView = new MenuSectionView("Albums") };
root.Add(albumSection);
var imageCount = Data.Database.Main.Table<ProjectImage>().Count();
_allProjects = new MenuElement("All Albums", imageCount.ToString(), UITableViewCellStyle.Value1) { Image = Images.Menu.AllAlbums };
_allProjects.Tapped += () => {
if (Data.Database.Main.Table<ProjectImage>().Count() > 0)
NavigationController.PushViewController(new LocalViewPatternsViewController() { Title = "All" }, true);
else
{
}
};
albumSection.Add(_allProjects);
var projects = Data.Database.Main.Table<Project>();
foreach (var p in projects)
{
var project = p;
var element = new ProjectElement(project, this) { Image = Images.Menu.Album };
albumSection.Add(element);
}
// albumSection.Add(new MenuElement("Add Album", () => {
// PresentViewController(new UINavigationController(new NewAlbumViewController((r) => {
// DismissViewController(true, null);
// })), true, null);
// }, null));
//
var moreSection = new Section() { HeaderView = new MenuSectionView("Info") };
root.Add(moreSection);
moreSection.Add(new MenuElement("About", () => NavigationController.PushViewController(new AboutController(), true), Images.Menu.Info));
moreSection.Add(new MenuElement("Feedback & Support", () => {
var config = UserVoice.UVConfig.Create("appreciateui.uservoice.com", "y2jtRDr35UyLi2fjSv16bA", "x9U5XhzGUPdsghNbzNq3UHxtGDeuETsuwT4ufmV2Q");
UserVoice.UserVoice.PresentUserVoiceInterface(this, config);
}, Images.Menu.Feedback));
Root = root;
}
开发者ID:GSerjo,项目名称:appreciateui,代码行数:64,代码来源:MenuController.cs
示例11: VerifySubFolderExists
protected virtual FolderNode VerifySubFolderExists(string path, HierarchyNode parent)
{
FolderNode folderNode = null;
uint uiItemId;
Url url = new Url(this.BaseURI, path);
string strFullPath = url.AbsoluteUrl;
// Folders end in our storage with a backslash, so add one...
this.ParseCanonicalName(strFullPath, out uiItemId);
if (uiItemId != (uint)VSConstants.VSITEMID.Nil)
{
Debug.Assert(this.NodeFromItemId(uiItemId) is FolderNode, "Not a FolderNode");
folderNode = (FolderNode)this.NodeFromItemId(uiItemId);
}
if (folderNode == null && path != null && parent != null)
{
// folder does not exist yet...
// We could be in the process of loading so see if msbuild knows about it
ProjectElement item = null;
foreach (MSBuild.ProjectItem folder in buildProject.GetItems(ProjectFileConstants.Folder))
{
if (String.Compare(folder.EvaluatedInclude.TrimEnd('\\'), path.TrimEnd('\\'), StringComparison.OrdinalIgnoreCase) == 0)
{
item = new ProjectElement(this, folder, false);
break;
}
}
// If MSBuild did not know about it, create a new one
if (item == null)
item = this.AddFolderToMsBuild(path);
folderNode = this.CreateFolderNode(path, item);
parent.AddChild(folderNode);
}
return folderNode;
}
开发者ID:IntelliTect,项目名称:PowerStudio,代码行数:36,代码来源:ProjectNode.cs
示例12: CreateFolderNode
/// <summary>
/// To support virtual folders, override this method to return your own folder nodes
/// </summary>
/// <param name="path">Path to store for this folder</param>
/// <param name="element">Element corresponding to the folder</param>
/// <returns>A FolderNode that can then be added to the hierarchy</returns>
public virtual FolderNode CreateFolderNode(string path, ProjectElement element)
{
if (element == null)
throw new ArgumentNullException("element");
FolderNode folderNode = new FolderNode(this, path, element);
return folderNode;
}
开发者ID:sharwell,项目名称:MPFProj10,代码行数:14,代码来源:ProjectNode.cs
示例13: GetDefaultNamespace
private string GetDefaultNamespace(ProjectElement project)
{
return project.DefaultNamespace ?? project.RootNamespace;
}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:4,代码来源:Refactor_UpdateNamespacePlugIn.cs
示例14: LoadFiles
protected virtual void LoadFiles(ProjectElement project, XmlDocument lDoc, string lProjectDir, string lProjectLangTag)
{
string lFilesQuery = GetFilesQuery(lProjectLangTag);
XmlNodeList lFiles = lDoc.SelectNodes(lFilesQuery);
int lCount = lFiles.Count;
for (int i = 0; i < lCount; i++)
{
System.Xml.XmlNode lFileNode = lFiles[i];
System.Xml.XmlNode lRelPath = lFileNode.Attributes.GetNamedItem(STR_RelPath);
string lFilePath = Path.Combine(lProjectDir, lRelPath.Value);
SourceFile proxy = project.AddDiskFile(lFilePath);
proxy.BuildProjectSymbols();
}
}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:14,代码来源:ProjectLoaderBase.cs
示例15: MyCustomProjectFileNode
/// <summary>
/// Initializes a new instance of the <see cref="MyCustomProjectFileNode"/> class.
/// </summary>
/// <param name="root">The project node.</param>
/// <param name="e">The project element node.</param>
internal MyCustomProjectFileNode(ProjectNode root, ProjectElement e)
: base(root, e)
{
}
开发者ID:ldematte,项目名称:BlenXVSP,代码行数:9,代码来源:MyCustomProjectFileNode.cs
示例16: AddNonmemberFolderItems
/// <summary>
/// Adds non member folder items to the hierarcy.
/// </summary>
/// <param name="project">The project to modify.</param>
/// <param name="folderList">Folders list containing the folder names.</param>
protected virtual void AddNonmemberFolderItems(IList<string> folderList)
{
if (folderList == null)
{
throw new ArgumentNullException("folderList");
}
foreach (string folderKey in folderList)
{
HierarchyNode parentNode = this;
string[] folders = folderKey.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
FolderNode topFolderNode = null;
foreach (string folder in folders)
{
string childNodeId = Path.Combine(parentNode.VirtualNodeName, folder);
HierarchyNode childNode = parentNode.FindChild(childNodeId, false);
if (childNode == null)
{
if (topFolderNode == null)
{
topFolderNode = parentNode as FolderNode;
if (topFolderNode != null && (!topFolderNode.IsNonmemberItem) && topFolderNode.IsExpanded)
{
topFolderNode = null;
}
}
ProjectElement element = new ProjectElement(this, null, true);
FolderNode folderNode = this.CreateFolderNode(childNodeId, element);
childNode = folderNode;
parentNode.AddChild(childNode);
}
parentNode = childNode;
}
if (topFolderNode != null)
{
topFolderNode.CollapseFolder();
}
}
}
开发者ID:sharwell,项目名称:MPFProj10,代码行数:47,代码来源:ProjectNode.cs
示例17: AddNonmemberFileItems
/// <summary>
/// Adds non member file items to the hierarcy.
/// </summary>
/// <param name="project">The project to modify.</param>
/// <param name="fileList">Files containing the information about the non member file items.</param>
protected virtual void AddNonmemberFileItems(IList<string> fileList)
{
if (fileList == null)
throw new ArgumentNullException("fileList");
foreach (string fileKey in fileList)
{
HierarchyNode parentNode = this;
FolderNode topFolderNode = null;
string canonicalName = fileKey;
if (!Path.IsPathRooted(canonicalName))
canonicalName = Path.Combine(ProjectManager.BaseUri.AbsoluteUrl, fileKey);
if (fileKey.IndexOfAny(new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }) < 0)
{
// the parent is the project node, just make sure this isn't the project file itself
if (NativeMethods.IsSamePath(ProjectFile, canonicalName))
continue;
}
else
{
string directoryCanonicalName = Path.GetDirectoryName(canonicalName) + '\\';
ReadOnlyCollection<HierarchyNode> parentFolderNodes = itemIdMap.GetNodesByName(directoryCanonicalName);
if (parentFolderNodes.Count == 1)
{
parentNode = parentFolderNodes[0];
for (HierarchyNode parentChain = parentNode; parentChain != null; parentChain = parentChain.Parent)
{
FolderNode folderNode = parentChain as FolderNode;
if (folderNode != null)
topFolderNode = folderNode;
}
if (topFolderNode != null && !topFolderNode.IsNonmemberItem && topFolderNode.IsExpanded)
topFolderNode = null;
}
}
ProjectElement element = new ProjectElement(this, null, true);
element.Rename(canonicalName);
element.SetMetadata(ProjectFileConstants.Name, canonicalName);
HierarchyNode childNode = this.CreateFileNode(element);
parentNode.AddChild(childNode);
if (topFolderNode != null)
{
topFolderNode.CollapseFolder();
}
}
}
开发者ID:sharwell,项目名称:MPFProj10,代码行数:56,代码来源:ProjectNode.cs
示例18: CreateFileNode
/// <summary>
/// Creates the file node.
/// </summary>
/// <param name="item">The project element item.</param>
/// <returns></returns>
public override FileNode CreateFileNode(ProjectElement item)
{
MyCustomProjectFileNode node = new MyCustomProjectFileNode(this, item);
node.OleServiceProvider.AddService(typeof(EnvDTE.Project), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
node.OleServiceProvider.AddService(typeof(ProjectItem), node.ServiceCreator, false);
node.OleServiceProvider.AddService(typeof(VSProject), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
return node;
}
开发者ID:DavidMoore,项目名称:Foundation,代码行数:15,代码来源:MyCustomProjectNode.cs
示例19: CreateFileNode
/// <summary>
/// Create a file node based on an msbuild item.
/// </summary>
/// <param name="item">msbuild item</param>
/// <returns>FileNode added</returns>
public virtual FileNode CreateFileNode(ProjectElement item)
{
return new FileNode(this, item);
}
开发者ID:IntelliTect,项目名称:PowerStudio,代码行数:9,代码来源:ProjectNode.cs
示例20: CreateDependentFileNode
/// <summary>
/// Create dependent file node based on an msbuild item
/// </summary>
/// <param name="item">msbuild item</param>
/// <returns>dependent file node</returns>
public virtual DependentFileNode CreateDependentFileNode(ProjectElement item)
{
return new DependentFileNode(this, item);
}
开发者ID:IntelliTect,项目名称:PowerStudio,代码行数:9,代码来源:ProjectNode.cs
注:本文中的ProjectElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论