public ProjectNode(ProjectEntry project, IconProvider iconProvider) : base(project.Project, project.FilePath.ParentDirectory, iconProvider) { ProjectEntry = project; ProjectEntry.LoadComplete += project_LoadComplete; var solution = ProjectEntry.GetRoot() as Solution; if (solution != null) { solution.Settings.StartupProjects.InsertedItem += StartupProjects_InsertedItem; solution.Settings.StartupProjects.RemovedItem += StartupProjects_RemovedItem; } if (project.HasProject) { ImageIndex = SelectedImageIndex = (_iconProvider = iconProvider).GetImageIndex(project); _propertiesNode = new PropertiesNode(iconProvider); if (project.Project is IAssemblyReferenceProvider) _referencesNode = new ReferencesNode(project.Project as IAssemblyReferenceProvider, iconProvider); } if (project.IsLoaded) Populate(); }
public SolutionExplorerContent() { InitializeComponent(); this.HideOnClose = true; this.Icon = Icon.FromHandle(Properties.Resources.folder.GetHicon()); _iconProvider = IconProvider.GetProvider<SolutionExplorerIconProvider>(); mainTreeView.ImageList = _iconProvider.ImageList; LiteDevelopApplication.Current.InitializedApplication += Current_InitializedApplication; }
public ReferencesNode(IFileReferenceProvider referenceProvider, IconProvider iconProvider) : base("References") { ReferenceProvider = referenceProvider; ReferenceProvider.References.InsertedItem += References_InsertedItem; ReferenceProvider.References.RemovedItem += References_RemovedItem; _iconProvider = iconProvider; ImageIndex = SelectedImageIndex = SolutionExplorerIconProvider.Index_ReferencesDirectory; foreach (var reference in referenceProvider.References) Nodes.Add(new FileReferenceNode(reference, _iconProvider)); }
public FileNode(ProjectFileEntry file, IconProvider iconProvider) : base(file.FilePath) { if (file == null) throw new ArgumentNullException("file"); if (iconProvider == null) throw new ArgumentNullException("iconProvider"); FileEntry = file; FileEntry.FilePathChanged += FileEntry_FilePathChanged; ImageIndex = SelectedImageIndex = (_iconProvider = iconProvider).GetImageIndex(file); }
public DirectoryNode(Project project, FilePath path, IconProvider iconProvider) : base(path) { if (project != null) { _project = project; project.ProjectFiles.InsertedItem += ProjectFiles_InsertedItem; project.ProjectFiles.RemovedItem += ProjectFiles_RemovedItem; } AddStub(); ImageIndex = SelectedImageIndex = (_iconProvider = iconProvider).GetImageIndex(new DirectoryInfo(path.FileName)); }
public SolutionFolderNode(SolutionFolder solutionFolder, IconProvider iconProvider) : base(solutionFolder.FilePath) { this.SolutionFolder = solutionFolder; this._iconProvider = iconProvider; Text = solutionFolder.Name; UpdateTextOnFilePathChanged = false; AddStub(); ImageIndex = SelectedImageIndex = (_iconProvider = iconProvider).GetImageIndex(solutionFolder); solutionFolder.Nodes.InsertedItem += Nodes_InsertedItem; solutionFolder.Nodes.RemovedItem += Nodes_RemovedItem; solutionFolder.FilePathChanged += solutionFolder_FilePathChanged; }
public void RenderBlockContextMenu() { int blockSourceNodeId = PreValueAccessor.BlockSourceNodeId; IconProvider iconProvider = new IconProvider(); try { var blocksSourceNode = new Node(blockSourceNodeId); var sb = new StringBuilder(); // Loop through each children and output accordingly. foreach (Node child in blocksSourceNode.Children) { RenderBlockSubList(child, sb, iconProvider); } plcBlocksContextMenu.Controls.Add(new LiteralControl(sb.ToString())); plcBlocksContextMenu2.Controls.Add(new LiteralControl(sb.ToString())); } catch { } }
public ReferenceNode(AssemblyReference reference, IconProvider iconProvider) : base(reference.AssemblyName) { ImageIndex = SelectedImageIndex = iconProvider.GetImageIndex(reference); Reference = reference; }
private string GetIconPath([CanBeNull] string command = null) { var icon = _target.Feed.GetIcon(Icon.MimeTypeIco, command); return(icon == null ? null : IconProvider.GetIconPath(icon, _handler, machineWide: false)); }
public PropertiesNode(IconProvider iconProvider) : base("Properties") { ImageIndex = SelectedImageIndex = SolutionExplorerIconProvider.Index_Properties; }
protected override void BuildClasses(ClassBuilder builder) { builder.Append(IconProvider.Icon(Name, IconStyle)); base.BuildClasses(builder); }
public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure <App>() .AfterSetup(_ => IconProvider.Register <FontAwesomeIconProvider>()) .UsePlatformDetect() .LogToTrace() .UseReactiveUI();
public void RenderBlockSubList(Node node, StringBuilder sb, IconProvider iconProvider) { string icon = iconProvider[node.NodeTypeAlias]; sb.AppendFormat("<li class='icon {0}' rel='{1}'><span class='icon{2}' style='background:url(\"{3}{4}\") no-repeat;'></span>{5}", node.NodeTypeAlias == "BlocksFolder" ? "folder" : "blockItem", node.Id, icon.StartsWith(".") ? " " + icon.TrimStart('.') : "", icon.StartsWith(".") ? "/umbraco/images/umbraco/sprites.png" : "/umbraco/images/umbraco/", !icon.StartsWith(".") ? icon : "", node.Name); if (node.Children.Count > 0) { sb.Append("<ul>"); foreach (Node child in node.Children) { RenderBlockSubList(child, sb, iconProvider); } sb.Append("</ul>"); } sb.Append("</li>"); }
public void ProviderNotFound() { string _ = IconProvider.GetIconPath("YouCantFindMe"); }
public void NullValue() { string iconPath = IconProvider.GetIconPath(null); Assert.AreEqual(string.Empty, iconPath); }
public static void ClassSetup(TestContext _) { IconProvider.Register(GetMockIconProvider()); }
public FileReferenceNode(string reference, IconProvider iconProvider) : base(Path.GetFileName(reference)) { ImageIndex = SelectedImageIndex = iconProvider.GetImageIndex(reference); Reference = reference; }
public object GetIcon(TransferItem item) { return(IconProvider.GetPath(item.remote, 16)); }
// Called after setup private static void AfterSetupCallback(AppBuilder appBuilder) { // Register icon provider(s) IconProvider.Register <FontAwesomeIconProvider>(); }
/// <summary> /// Registers a predefined icon provider. /// </summary> /// <param name="serviceCollection"></param> /// <param name="iconProvider"></param> public static IServiceCollection AddIconProvider(this IServiceCollection serviceCollection, IconProvider iconProvider) { if (iconProvider == IconProvider.FontAwesome) { serviceCollection.AddSingleton <IIconProvider, FontAwesomeIconProvider>(); } else if (iconProvider == IconProvider.Material) { serviceCollection.AddSingleton <IIconProvider, MaterialIconProvider>(); } else { throw new NotImplementedException("Icon provider is not supported."); } return(serviceCollection); }
public SolutionNode(Solution solution, IconProvider iconProvider) : base(solution, iconProvider) { Solution = solution; }
public ErrorControl() { InitializeComponent(); _iconProvider = IconProvider.GetProvider <ErrorIconProvider>(); }