aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewsContracts/IMachineUpdateView.cs
blob: d71822b1182f9b8aba4685efd22894f17b984395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.PPC.Common;
using static Tango.PPC.UI.ViewModels.MachineUpdateViewVM;

namespace Tango.PPC.UI.ViewsContracts
{
    public interface IMachineUpdateView : IPPCView
    {
        /// <summary>
        /// Navigates to the specified machine setup view.
        /// </summary>
        /// <param name="view">The view.</param>
        Task NavigateTo(MachineUpdateView view);
    }
}
ass="nn">System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Logging; namespace Tango.Protobuf { /// <summary> /// Represents an <see cref="IProtoCompiler"/> folder compilation result. /// </summary> /// <seealso cref="Tango.Protobuf.ICompilerResult" /> public class CompilerFolderResult : ICompilerResult { private LogManager LogManager = LogManager.Default; /// <summary> /// Initializes a new instance of the <see cref="CompilerFolderResult"/> class. /// </summary> /// <param name="results">The results.</param> /// <param name="language">The language.</param> /// <param name="sourcePath">The source path.</param> /// <param name="relativePath">The relative path.</param> public CompilerFolderResult(IEnumerable<ICompilerResult> results, CompilerLanguage language, String sourcePath, String relativePath) { Results = results; Language = language; SourcePath = sourcePath; RelativePath = relativePath; Name = Path.GetFileName(sourcePath); } /// <summary> /// Gets the compiler results. /// </summary> public IEnumerable<ICompilerResult> Results { get; private set; } /// <summary> /// Gets the result language. /// </summary> public CompilerLanguage Language { get; private set; } /// <summary> /// Gets the result source path. /// </summary> public String SourcePath { get; private set; } /// <summary> /// Gets the result name. /// </summary> public String Name { get; private set; } /// <summary> /// Gets the result relative path. /// </summary> public String RelativePath { get; private set; } /// <summary> /// Saves the result to the specified folder. /// </summary> /// <param name="folder">The folder.</param> public void Save(string folder) { LogManager.Log("Saving " + folder + "..."); foreach (var fileResult in Results.OfType<CompilerFileResult>()) { fileResult.Save(folder); } foreach (var folderResult in Results.OfType<CompilerFolderResult>()) { folderResult.Save(Path.Combine(folder, folderResult.RelativePath.TrimStart('\\','\\'))); } } /// <summary> /// Returns a <see cref="System.String" /> that represents this instance. /// </summary> /// <returns> /// A <see cref="System.String" /> that represents this instance. /// </returns> public override string ToString() { String output = Name + Environment.NewLine + ":"; foreach (var fileResult in Results.OfType<CompilerFileResult>()) { output += fileResult.ToString() + Environment.NewLine; } foreach (var folderResult in Results.OfType<CompilerFolderResult>()) { output += folderResult.ToString() + Environment.NewLine; } return output; } } }