本文整理汇总了C#中ProjectElement类的典型用法代码示例。如果您正苦于以下问题:C# ProjectElement类的具体用法?C# ProjectElement怎么用?C# ProjectElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectElement类属于命名空间,在下文中一共展示了ProjectElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
}
示例8: LoadCompileUnits
protected virtual void LoadCompileUnits(ProjectElement project, XmlDocument lDoc, string lProjectDir, string lProjectLangTag)
{
}
示例9: LoadRootNamespace
protected override void LoadRootNamespace(ProjectElement project, XmlDocument lDoc, string lProjectDir, string lProjectLangTag)
{
base.LoadRootNamespace(project, lDoc, lProjectDir, lProjectLangTag);
}
示例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;
}
示例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;
}
示例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;
}
示例13: GetDefaultNamespace
private string GetDefaultNamespace(ProjectElement project)
{
return project.DefaultNamespace ?? project.RootNamespace;
}
示例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();
}
}
示例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)
{
}