Esempio n. 1
0
		private Element CreateElement(SourceTreeViewModel.SourceModel x)
        {
            if (x.Type.Equals("dir", StringComparison.OrdinalIgnoreCase))
                return new StyledStringElement(x.Name, () => ViewModel.GoToSourceTreeCommand.Execute(x), AtlassianIcon.Devtoolsfolderclosed.ToImage());
            if (x.Type.Equals("file", StringComparison.OrdinalIgnoreCase))
                return new StyledStringElement(x.Name, () => ViewModel.GoToSourceCommand.Execute(x), AtlassianIcon.Devtoolsfile.ToImage());
            return new StyledStringElement(x.Name) { Image = AtlassianIcon.Devtoolsfilebinary.ToImage() };
        }
Esempio n. 2
0
		private Element CreateElement(SourceTreeViewModel.SourceModel x)
        {
            if (x.Type.Equals("dir", StringComparison.OrdinalIgnoreCase))
                return new StyledStringElement(x.Name, () => ViewModel.GoToSourceTreeCommand.Execute(x), Images.Folder);
            if (x.Type.Equals("file", StringComparison.OrdinalIgnoreCase))
				return new StyledStringElement(x.Name, () => ViewModel.GoToSourceCommand.Execute(x), Images.File);
            return new StyledStringElement(x.Name) { Image = Images.File };
        }
Esempio n. 3
0
 private static Element CreateElement(SourceTreeViewModel.SourceModel x, WeakReference<SourceTreeViewModel> viewModel)
 {
     if (x.Type.Equals("dir", StringComparison.OrdinalIgnoreCase))
     {
         var e = new StringElement(x.Name, AtlassianIcon.Devtoolsfolderclosed.ToImage());
         e.Clicked.Select(_ => x).BindCommand(viewModel.Get()?.GoToSourceCommand);
         return e;
     }
     if (x.Type.Equals("file", StringComparison.OrdinalIgnoreCase))
     {
         var e = new StringElement(x.Name, AtlassianIcon.Devtoolsfile.ToImage());
         e.Clicked.Select(_ => x).BindCommand(viewModel.Get()?.GoToSourceCommand);
         return e;
     }
     return new StringElement(x.Name) { Image = AtlassianIcon.Devtoolsfilebinary.ToImage() };
 }