public GradleProjectGenerator(String SolutionName, Project Project, List <ProjectReference> ProjectReferences, PathString InputDirectory, PathString OutputDirectory, PathString SolutionOutputDirectory, String BuildGradleTemplateText, OperatingSystemType HostOperatingSystem, ArchitectureType HostArchitecture, OperatingSystemType TargetOperatingSystem, ArchitectureType?TargetArchitecture, ToolchainType Toolchain, CompilerType Compiler, CLibraryType CLibrary, CLibraryForm CLibraryForm, CppLibraryType CppLibrary, CppLibraryForm CppLibraryForm, ConfigurationType?ConfigurationType, PathString AndroidNdk)
 {
     this.SolutionName            = SolutionName;
     this.ProjectName             = Project.Name.Split(':').First();
     this.Project                 = Project;
     this.ProjectReferences       = ProjectReferences;
     this.InputDirectory          = InputDirectory.FullPath;
     this.OutputDirectory         = OutputDirectory.FullPath;
     this.SolutionOutputDirectory = SolutionOutputDirectory.FullPath;
     this.BuildGradleTemplateText = BuildGradleTemplateText;
     this.HostOperatingSystem     = HostOperatingSystem;
     this.HostArchitecture        = HostArchitecture;
     this.TargetOperatingSystem   = TargetOperatingSystem;
     this.TargetArchitecture      = TargetArchitecture;
     if (!TargetArchitecture.HasValue)
     {
         throw new NotSupportedException("ArchitectureTypeIsNull");
     }
     this.Toolchain         = Toolchain;
     this.Compiler          = Compiler;
     this.CLibrary          = CLibrary;
     this.CLibraryForm      = CLibraryForm;
     this.CppLibrary        = CppLibrary;
     this.CppLibraryForm    = CppLibraryForm;
     this.ConfigurationType = ConfigurationType;
     this.AndroidNdk        = AndroidNdk;
 }
Exemplo n.º 2
0
        public static int PortToInt(string portString)
        {
            string prefix            = String.Empty;
            OperatingSystemType plat = Common.OperatingSystem.GetOperatingSystemType();

            if (plat == OperatingSystemType.Windows)
            {
                prefix = WinComPrefix;
            }
            else if (plat == OperatingSystemType.Linux)
            {
                prefix = LinuxSysComPrefix;
                LinuxCom linuxCom = GlobalConfigTool.GlobalConfig.LinuxComList.FirstOrDefault(l => portString.Contains(l.LinuxPort.ToString()));
                if (linuxCom != null)
                {
                    if (linuxCom.LinuxComType == LinuxComType.Usb)
                    {
                        prefix = LinuxUsbComPrefix;
                    }
                    else if (linuxCom.LinuxComType == LinuxComType.System)
                    {
                        prefix = LinuxSysComPrefix;
                    }
                }
            }

            if (prefix.Length > 0)
            {
                return(int.Parse(portString.Substring(prefix.Length)));
            }
            else
            {
                throw new IndexOutOfRangeException("串口字符串无法转换");
            }
        }
Exemplo n.º 3
0
        private static List <string> GetConditions(OperatingSystemType OperatingSystem, List <ConfigurationType> MatchingConfigurationTypes, List <ArchitectureType> MatchingTargetArchitectures)
        {
            List <string> Conditions;

            if ((MatchingConfigurationTypes != null) || (MatchingTargetArchitectures != null))
            {
                var Keys   = "";
                var Values = new List <String> {
                    ""
                };
                if (MatchingConfigurationTypes != null)
                {
                    Keys   = (Keys != "" ? Keys + "|" : "") + "$(Configuration)";
                    Values = MatchingConfigurationTypes.SelectMany(t => Values.Select(v => (v != "" ? v + "|" : "") + t.ToString())).ToList();
                }
                if (MatchingTargetArchitectures != null)
                {
                    Keys   = (Keys != "" ? Keys + "|" : "") + "$(Platform)";
                    Values = MatchingTargetArchitectures.SelectMany(a => Values.Select(v => (v != "" ? v + "|" : "") + GetArchitectureString(OperatingSystem, a))).ToList();
                }
                Conditions = Values.Select(v => "'" + Keys + "' == '" + v + "'").ToList();
            }
            else
            {
                Conditions = new List <String> {
                    null
                };
            }

            return(Conditions);
        }
 public OSInfo(string displayName, string templateName, int priority, OperatingSystemType ostype)
 {
     DisplayName  = displayName;
     TemplateName = templateName;
     Priority     = priority;
     OSType       = ostype;
 }
Exemplo n.º 5
0
        public void returns_expected_command_shell_when_shell_is_not_defined(OperatingSystemType operatingSystemType, string expected)
        {
            var sut    = new RealCommandFactory(new StubOperatingSystemTypeProvider(operatingSystemType));
            var result = sut.Create("?");

            Assert.Equal(expected, result.Shell);
        }
Exemplo n.º 6
0
        public void returns_expected_default_shell(OperatingSystemType operatingSystemType, string expected)
        {
            var sut    = new RealCommandFactory(new StubOperatingSystemTypeProvider(operatingSystemType));
            var result = sut.GetDefaultOSShell();

            Assert.Equal(expected, result);
        }
Exemplo n.º 7
0
 public static String GetArchitectureString(OperatingSystemType OperatingSystem, ArchitectureType Architecture)
 {
     if (Architecture == ArchitectureType.x86)
     {
         if (OperatingSystem == OperatingSystemType.Windows)
         {
             return("Win32");
         }
         else
         {
             return("x86");
         }
     }
     else if (Architecture == ArchitectureType.x64)
     {
         return("x64");
     }
     else if (Architecture == ArchitectureType.armv7a)
     {
         return("ARM");
     }
     else if (Architecture == ArchitectureType.arm64)
     {
         return("ARM64");
     }
     else
     {
         throw new NotSupportedException("NotSupportedArchitecture: " + Architecture.ToString());
     }
 }
Exemplo n.º 8
0
        public static string PortToString(int port)
        {
            string prefix            = String.Empty;
            OperatingSystemType plat = Common.OperatingSystem.GetOperatingSystemType();

            if (plat == OperatingSystemType.Windows)
            {
                prefix = WinComPrefix;
            }
            else if (plat == OperatingSystemType.Linux)
            {
                prefix = LinuxSysComPrefix;
                LinuxCom linuxCom = GlobalConfigTool.GlobalConfig.LinuxComList.FirstOrDefault(l => l.LinuxPort == port);
                if (linuxCom != null)
                {
                    if (linuxCom.LinuxComType == LinuxComType.Usb)
                    {
                        prefix = LinuxUsbComPrefix;
                    }
                    else if (linuxCom.LinuxComType == LinuxComType.System)
                    {
                        prefix = LinuxSysComPrefix;
                    }
                }
            }
            return(String.Format("{0}{1}", prefix, port.ToString()));
        }
 public ExportRenderingSubsystemAttribute(OperatingSystemType requiredOS, int priority, string name, Type initializationType, string initializationMethod)
 {
     Name = name;
     InitializationType = initializationType;
     InitializationMethod = initializationMethod;
     RequiredOS = requiredOS;
     Priority = priority;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExportRenderingSubsystemAttribute"/> class.
 /// </summary>
 /// <param name="requiredOS"></param>
 /// <param name="priority"></param>
 /// <param name="name"></param>
 /// <param name="initializationType"></param>
 /// <param name="initializationMethod"></param>
 public ExportRenderingSubsystemAttribute(OperatingSystemType requiredOS, int priority, string name, Type initializationType, string initializationMethod)
 {
     Name = name;
     InitializationType   = initializationType;
     InitializationMethod = initializationMethod;
     RequiredOS           = requiredOS;
     Priority             = priority;
 }
Exemplo n.º 11
0
 public override string ToString()
 {
     return($"PC Info:\n\t>>> Processor: {Processor} - {ProcessorInGHz} GHz - {ProcessorCount} cores.\n\t" +
            $">>> RAM: {RAMType.ToString()} {RAMSizeInGb} Gb.\n\t" +
            $">>> Graphics card: {GraphicsCard.ToString()} {GraphicsCardMemoryInMb} Mb.\n\t" +
            $">>> Hard Disk: {HardDiskType.ToString()} {HardDiskSizeInGb} Gb.\n\t" +
            $">>> OS: {OperatingSystemType.ToString()} {OperatingSystemVersion}.");
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExportWindowingSubsystemAttribute"/> class.
 /// </summary>
 /// <param name="requiredRuntimePlatform"></param>
 /// <param name="priority"></param>
 /// <param name="name"></param>
 /// <param name="initializationType"></param>
 /// <param name="initializationMethod"></param>
 public ExportWindowingSubsystemAttribute(OperatingSystemType requiredRuntimePlatform, int priority, string name, Type initializationType, string initializationMethod)
 {
     Name = name;
     InitializationType   = initializationType;
     InitializationMethod = initializationMethod;
     RequiredOS           = requiredRuntimePlatform;
     Priority             = priority;
 }
 public ExportWindowingSubsystemAttribute(OperatingSystemType requiredRuntimePlatform, int priority, string name, Type initializationType, string initializationMethod)
 {
     Name = name;
     InitializationType = initializationType;
     InitializationMethod = initializationMethod;
     RequiredOS = requiredRuntimePlatform;
     Priority = priority;
 }
Exemplo n.º 14
0
 public Phone(string model, string brand, double price, OperatingSystemType type, bool isAvailable, Shop shop)
 {
     Model       = model;
     Brand       = brand;
     Price       = price;
     Type        = type;
     IsAvailable = isAvailable;
     ShopPlace   = shop;
 }
        //AddDataDisk
        //DeleteDataDisk
        //GetDataDisk
        //UpdateDataDisk
        public Task<string> CreateDiskAsync(string name, string label, Uri linkToBlob, OperatingSystemType osType = OperatingSystemType.None,
                                                                                       CancellationToken token = default(CancellationToken))
        {
            VirtualHardDisk info = new VirtualHardDisk(name, label, linkToBlob, osType);

            HttpRequestMessage message = CreateBaseMessage(HttpMethod.Post, CreateTargetUri(UriFormatStrings.Disks), info);

            return StartSendTask(message, token);
        }
Exemplo n.º 16
0
 public PbxprojGenerator(Project Project, List <ProjectReference> ProjectReferences, String InputDirectory, String OutputDirectory, String PbxprojTemplateText, OperatingSystemType BuildingOperatingSystem, OperatingSystemType TargetOperatingSystem)
 {
     this.Project                 = Project;
     this.ProjectReferences       = ProjectReferences;
     this.InputDirectory          = InputDirectory;
     this.OutputDirectory         = OutputDirectory;
     this.PbxprojTemplateText     = PbxprojTemplateText;
     this.BuildingOperatingSystem = BuildingOperatingSystem;
     this.TargetOperatingSystem   = TargetOperatingSystem;
 }
Exemplo n.º 17
0
 public Make(ToolchainType Toolchain, CompilerType Compiler, OperatingSystemType TargetOperationSystem, String SourceDirectory, String BuildDirectory, bool EnableRebuild)
 {
     this.Toolchain               = Toolchain;
     this.Compiler                = Compiler;
     this.TargetOperationSystem   = TargetOperationSystem;
     this.SourceDirectory         = SourceDirectory;
     this.BuildDirectory          = BuildDirectory;
     this.EnableRebuild           = EnableRebuild;
     this.BuildingOperatingSystem = OperatingSystemType.Windows;
 }
Exemplo n.º 18
0
 public static OSVirtualHardDisk OSDiskFromVirtualDisk(string diskName, OperatingSystemType osType, string label = null, HostCaching caching = HostCaching.ReadWrite)
 {
     return new OSVirtualHardDisk
     {
         HostCaching = caching,
         DiskLabel = label,
         DiskName = diskName,
         OSType = osType
     };
 }
Exemplo n.º 19
0
 public static OSVirtualHardDisk OSDiskFromLink(Uri mediaLink, OperatingSystemType osType, string label = null, HostCaching caching = HostCaching.ReadWrite)
 {
     return new OSVirtualHardDisk
     {
         HostCaching = caching,
         DiskLabel = label,
         MediaLink = mediaLink,
         OSType = osType
     };
 }
Exemplo n.º 20
0
 public ExportRenderingSubsystemAttribute(OperatingSystemType requiredOS, int priority, string name, Type initializationType, string initializationMethod,
                                          Type?environmentChecker = null)
 {
     Name = name;
     InitializationType   = initializationType;
     InitializationMethod = initializationMethod;
     EnvironmentChecker   = environmentChecker;
     RequiredOS           = requiredOS;
     Priority             = priority;
 }
Exemplo n.º 21
0
 public SlnGenerator(String SolutionName, String SolutionId, List <ProjectReference> ProjectReferences, PathString OutputDirectory, String SlnTemplateText, OperatingSystemType TargetOperatingSystem, ArchitectureType TargetArchitecture)
 {
     this.SolutionName          = SolutionName;
     this.SolutionId            = SolutionId;
     this.ProjectReferences     = ProjectReferences;
     this.OutputDirectory       = OutputDirectory.FullPath;
     this.TargetOperatingSystem = TargetOperatingSystem;
     this.TargetArchitecture    = TargetArchitecture;
     this.SlnTemplateText       = SlnTemplateText;
 }
 /// <summary>
 /// Initializes a new instance of the UpdateConfiguration class.
 /// </summary>
 /// <param name="operatingSystem">operating system of target machines.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="windows">Windows specific update
 /// configuration.</param>
 /// <param name="linux">Linux specific update configuration.</param>
 /// <param name="duration">Maximum time allowed for the software update
 /// configuration run. Duration needs to be specified using the format
 /// PT[n]H[n]M[n]S as per ISO8601</param>
 /// <param name="azureVirtualMachines">List of azure resource Ids for
 /// azure virtual machines targeted by the software update
 /// configuration.</param>
 /// <param name="nonAzureComputerNames">List of names of non-azure
 /// machines targeted by the software update configuration.</param>
 /// <param name="targets">Group targets for the software update
 /// configuration.</param>
 public UpdateConfiguration(OperatingSystemType operatingSystem, WindowsProperties windows = default(WindowsProperties), LinuxProperties linux = default(LinuxProperties), System.TimeSpan?duration = default(System.TimeSpan?), IList <string> azureVirtualMachines = default(IList <string>), IList <string> nonAzureComputerNames = default(IList <string>), TargetProperties targets = default(TargetProperties))
 {
     OperatingSystem       = operatingSystem;
     Windows               = windows;
     Linux                 = linux;
     Duration              = duration;
     AzureVirtualMachines  = azureVirtualMachines;
     NonAzureComputerNames = nonAzureComputerNames;
     Targets               = targets;
     CustomInit();
 }
Exemplo n.º 23
0
 public static OSVirtualHardDisk OSDiskFromImage(string imageName, OperatingSystemType osType, Uri targetBlob, string label = null, HostCaching caching = HostCaching.ReadWrite)
 {
     return new OSVirtualHardDisk
     {
         HostCaching = caching,
         DiskLabel = label,
         SourceImageName = imageName,
         OSType = osType,
         MediaLink = targetBlob
     };
 }
Exemplo n.º 24
0
 public CMakeProjectGenerator(Project Project, List <ProjectReference> ProjectReferences, String InputDirectory, String OutputDirectory, ToolchainType Toolchain, CompilerType Compiler, OperatingSystemType BuildingOperatingSystem, OperatingSystemType TargetOperatingSystem)
 {
     this.Project                 = Project;
     this.ProjectReferences       = ProjectReferences;
     this.InputDirectory          = InputDirectory;
     this.OutputDirectory         = OutputDirectory;
     this.Toolchain               = Toolchain;
     this.Compiler                = Compiler;
     this.BuildingOperatingSystem = BuildingOperatingSystem;
     this.TargetOperatingSystem   = TargetOperatingSystem;
 }
Exemplo n.º 25
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Primary != false)
            {
                hash ^= Primary.GetHashCode();
            }
            if (Username.Length != 0)
            {
                hash ^= Username.GetHashCode();
            }
            if (Uid != 0L)
            {
                hash ^= Uid.GetHashCode();
            }
            if (Gid != 0L)
            {
                hash ^= Gid.GetHashCode();
            }
            if (HomeDirectory.Length != 0)
            {
                hash ^= HomeDirectory.GetHashCode();
            }
            if (Shell.Length != 0)
            {
                hash ^= Shell.GetHashCode();
            }
            if (Gecos.Length != 0)
            {
                hash ^= Gecos.GetHashCode();
            }
            if (SystemId.Length != 0)
            {
                hash ^= SystemId.GetHashCode();
            }
            if (AccountId.Length != 0)
            {
                hash ^= AccountId.GetHashCode();
            }
            if (OperatingSystemType != global::Google.Cloud.OsLogin.Common.OperatingSystemType.Unspecified)
            {
                hash ^= OperatingSystemType.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 26
0
 public NinjaSolutionGenerator(String SolutionName, List <ProjectReference> ProjectReferences, PathString ProjectOutputDirectory, OperatingSystemType TargetOperatingSystem, String CC, String CXX, String AR, String STRIP)
 {
     this.SolutionName           = SolutionName;
     this.ProjectReferences      = ProjectReferences;
     this.ProjectOutputDirectory = ProjectOutputDirectory.FullPath;
     this.TargetOperatingSystem  = TargetOperatingSystem;
     this.CC    = CC;
     this.CXX   = CXX;
     this.AR    = AR;
     this.STRIP = STRIP;
 }
Exemplo n.º 27
0
        public static void GetLogs(
            OperatingSystemType clusterOperatingSystemType, CloudTable cloudTable,
            DateTimeOffset dateTimeMin, DateTimeOffset dateTimeMax,
            string roleName       = null, string roleInstance = null, string componentName = null,
            string endpointSuffix = "core.windows.net")
        {
            //string partitionKeyMin = string.Format("0000000000000000000___{0}", new DateTime(dateTimeMin.Ticks, DateTimeKind.Unspecified).ToBinary().ToString("D19"));
            //string partitionKeyMax = string.Format("0000000000000000100___{0}", new DateTime(dateTimeMax.Ticks, DateTimeKind.Unspecified).ToBinary().ToString("D19"));
            //Logger.InfoFormat(partitionKeyMin);
            //Logger.InfoFormat(partitionKeyMax);

            var filters = new List <FilterClause>()
            {
                //new FilterClause("PartitionKey", "gt", partitionKeyMin),
                //new FilterClause("PartitionKey", "lt", partitionKeyMax),
                new FilterClause("Timestamp", QueryComparisons.GreaterThan, dateTimeMin),                   //2012-12-23T21:11:32.8339201Z
                new FilterClause("Timestamp", QueryComparisons.LessThan, dateTimeMax)
                //new FilterClause("TraceLevel", QueryComparisons.Equal, "Error"),
                //new FilterClause("Role", QueryComparisons.Equal, "workernode")
            };

            if (!String.IsNullOrEmpty(roleName))
            {
                filters.Add(new FilterClause("Role", "eq", roleName));
            }

            if (!String.IsNullOrEmpty(roleInstance))
            {
                if (clusterOperatingSystemType == OperatingSystemType.Linux)
                {
                    filters.Add(new FilterClause("Host", "eq", roleInstance));
                }
                else
                {
                    filters.Add(new FilterClause("RoleInstance", "eq", roleInstance));
                }
            }

            if (!String.IsNullOrEmpty(componentName))
            {
                filters.Add(new FilterClause("ComponentName", "eq", componentName));
            }

            var query = BuildQuery <HadoopServiceLogEntity>(filters);

            Logger.InfoFormat("Query = {0}", query.FilterString);

            var logList = RunQuery(clusterOperatingSystemType, cloudTable, query);

            HDInsightClusterLogsWriter.Write(clusterOperatingSystemType, cloudTable.Name + ".xlsx", logList);

            Logger.InfoFormat("Done - {0}. Rows: {1}", cloudTable.Name, logList.Count);
        }
        internal static string ToSerializedValue(this OperatingSystemType value)
        {
            switch (value)
            {
            case OperatingSystemType.Windows:
                return("Windows");

            case OperatingSystemType.Linux:
                return("Linux");
            }
            return(null);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Tries to fetch the default package directory for NuGet packages.
        /// Taken from:
        /// https://github.com/dotnet/core-setup/blob/master/src/Microsoft.Extensions.DependencyModel/Resolution/PackageCompilationAssemblyResolver.cs#L41-L64
        /// </summary>
        /// <param name="osPlatform">OS Platform to fetch default package
        /// directory for.</param>
        /// <returns>The path to the default package directory; null if none
        /// could be set.</returns>
        private static string GetDefaultPackageDirectory(OperatingSystemType osPlatform)
        {
            var packageDirectory = Environment.GetEnvironmentVariable("NUGET_PACKAGES");

            if (!string.IsNullOrEmpty(packageDirectory))
            {
                return(packageDirectory);
            }

            var basePath = Environment.GetEnvironmentVariable(osPlatform == OperatingSystemType.Windows ? "USERPROFILE" : "HOME");

            return(string.IsNullOrEmpty(basePath) ? null : Path.Combine(basePath, ".nuget", "packages"));
        }
Exemplo n.º 30
0
        public int CalculatePhonesByType(OperatingSystemType type)
        {
            int amount = 0;

            foreach (var phone in Phones)
            {
                if (phone.Type == type && phone.IsAvailable == true)
                {
                    amount++;
                }
            }
            return(amount);
        }
Exemplo n.º 31
0
        public DataService(OperatingSystemType OperatingSystemType, string url)
        {
            this.OperatingSystemType = OperatingSystemType;

            string dir = GetDir();

            if (string.IsNullOrWhiteSpace(dir))
            {
                this.Url = $"{url}/api";
            }
            else
            {
                this.Url = $"{url}/api/{dir}";
            }
        }
Exemplo n.º 32
0
        public DataService(OperatingSystemType OperatingSystemType)
        {
            this.OperatingSystemType = OperatingSystemType;

            string dir = GetDir();

            if (string.IsNullOrWhiteSpace(dir))
            {
                this.Url = $"{Config.GetApiLocation()}/api";
            }
            else
            {
                this.Url = $"{Config.GetApiLocation()}/api/{dir}";
            }
        }
Exemplo n.º 33
0
        public object Convert(object input)
        {
            var inputString = (string)input;

            if (inputString.Contains("Windows"))
            {
                OperatingSystemType os = OperatingSystemType.Windows;

                #region Detect Specific Windows Version

                if (inputString.Contains("Windows XP"))
                {
                    os = OperatingSystemType.WindowsXP;
                }
                else if (inputString.Contains("Vista"))
                {
                    os = OperatingSystemType.WindowsVista;
                }
                else if (inputString.Contains("Windows 7"))
                {
                    os = OperatingSystemType.Windows7;
                }
                else if (inputString.Contains("Windows 8"))
                {
                    os = OperatingSystemType.Windows8;
                }
                else if (inputString.Contains("Windows 10"))
                {
                    os = OperatingSystemType.Windows10;
                }

                #endregion

                return(os);
            }
            if (inputString.Contains("Linux"))
            {
                return(OperatingSystemType.Linux);
            }
            if (inputString.Contains("OSX"))
            {
                return(OperatingSystemType.OSX);
            }

            throw new FormatException(String.Format(CultureInfo.InvariantCulture,
                                                    "Failed to parse OS value from '{0}'.", inputString));
        }
Exemplo n.º 34
0
        public static ILibraryLoader Get(OperatingSystemType os)
        {
            switch (os)
            {
            case OperatingSystemType.Windows:
                return(new WindowsLoader());

            case OperatingSystemType.Darwin:
                return(new DarwinLoader());

            case OperatingSystemType.Linux:
                return(new LinuxLoader());

            default:
                throw new PlatformNotSupportedException($"This operating system ({os}) is not supported");
            }
        }
Exemplo n.º 35
0
        public static OperatingSystemType GetOperatingSystemType()
        {
            OperatingSystemType type = OperatingSystemType.Windows;
            string osType            = Environment.OSVersion.Platform.ToString();

            switch (osType)
            {
            case "Win32NT":
                type = OperatingSystemType.Windows;
                break;

            case "Unix":
                type = OperatingSystemType.Linux;
                break;
            }
            return(type);
        }
Exemplo n.º 36
0
 public NinjaProjectGenerator(Project Project, List <ProjectReference> ProjectReferences, PathString InputDirectory, PathString OutputDirectory, OperatingSystemType HostOperatingSystem, ArchitectureType HostArchitecture, OperatingSystemType TargetOperatingSystem, ArchitectureType TargetArchitecture, WindowsRuntimeType?WindowsRuntime, ToolchainType Toolchain, CompilerType Compiler, CLibraryType CLibrary, CLibraryForm CLibraryForm, CppLibraryType CppLibrary, CppLibraryForm CppLibraryForm, ConfigurationType ConfigurationType)
 {
     this.Project               = Project;
     this.ProjectReferences     = ProjectReferences;
     this.InputDirectory        = InputDirectory.FullPath;
     this.OutputDirectory       = OutputDirectory.FullPath;
     this.HostOperatingSystem   = HostOperatingSystem;
     this.HostArchitecture      = HostArchitecture;
     this.TargetOperatingSystem = TargetOperatingSystem;
     this.TargetArchitecture    = TargetArchitecture;
     this.WindowsRuntime        = WindowsRuntime;
     this.Toolchain             = Toolchain;
     this.Compiler              = Compiler;
     this.CLibrary              = CLibrary;
     this.CLibraryForm          = CLibraryForm;
     this.CppLibrary            = CppLibrary;
     this.CppLibraryForm        = CppLibraryForm;
     this.ConfigurationType     = ConfigurationType;
 }
        static void Create(string subscriptionId, string resourceGroupName, string clusterDnsName, string clusterLocation,
            List<AzureStorageConfig> asvAccounts, int clusterSize, string clusterUsername, string clusterPassword,
            string hdInsightVersion, List<SqlAzureConfig> sqlAzureMetaStores,
            ClusterType clusterType, OperatingSystemType osType)
        {
            Logger.InfoFormat("ResourceGroup: {0}, Cluster: {1} - Submitting a new cluster deployment request", resourceGroupName, clusterDnsName);

            var clusterCreateParameters = new ClusterCreateParameters()
                {
                    ClusterSizeInNodes = clusterSize,
                    ClusterType = (HDInsightClusterType)Enum.Parse(typeof(HDInsightClusterType), clusterType.ToString()),
                    DefaultStorageAccountKey = asvAccounts[0].Key,
                    DefaultStorageAccountName = asvAccounts[0].Name,
                    DefaultStorageContainer = asvAccounts[0].Container,
                    Location = clusterLocation,
                    Password = clusterPassword,
                    UserName = clusterUsername,
                    Version = hdInsightVersion,
                    OSType = (OSType)Enum.Parse(typeof(OSType), osType.ToString()),
                };

            if (clusterCreateParameters.OSType == OSType.Linux)
            {
                clusterCreateParameters.SshUserName = config.SshUsername;
                if (String.IsNullOrWhiteSpace(config.SshPassword))
                {
                    var publicKey = File.ReadAllText(config.SshPublicKeyFilePath);
                    Logger.Debug("SSH RSA Public Key: " + Environment.NewLine + publicKey + Environment.NewLine);
                    clusterCreateParameters.SshPublicKey = publicKey;
                }
                else
                {
                    clusterCreateParameters.SshPassword = config.SshPassword;
                }
            }
            else
            {
                if (config.AutoEnableRdp)
                {
                    clusterCreateParameters.RdpUsername = config.RdpUsername;
                    clusterCreateParameters.RdpPassword = config.RdpPassword;
                    clusterCreateParameters.RdpAccessExpiry = DateTime.Now.AddDays(int.Parse(config.RdpExpirationInDays));
                }
            }

            if (sqlAzureMetaStores != null && sqlAzureMetaStores.Count > 0)
            {
                var hiveMetastore = sqlAzureMetaStores.FirstOrDefault(s => s.Type.Equals("HiveMetastore"));
                if (hiveMetastore != null)
                {
                    clusterCreateParameters.HiveMetastore =
                        new Metastore(hiveMetastore.Server, hiveMetastore.Database, hiveMetastore.User, hiveMetastore.Password);
                }

                var oozieMetastore = sqlAzureMetaStores.FirstOrDefault(s => s.Type.Equals("OozieMetastore"));
                if (oozieMetastore != null)
                {
                    clusterCreateParameters.OozieMetastore =
                        new Metastore(oozieMetastore.Server, oozieMetastore.Database, oozieMetastore.User, oozieMetastore.Password);
                }
            }

            var localStopWatch = Stopwatch.StartNew();

            var createTask = hdInsightManagementClient.Clusters.CreateAsync(resourceGroupName, clusterDnsName, clusterCreateParameters);
            Logger.InfoFormat("Cluster: {0} - Create cluster request submitted with task id: {1}, task status: {2}",
                clusterDnsName, createTask.Id, createTask.Status);

            Thread.Sleep(pollInterval);

            var error = MonitorCreate(resourceGroupName, clusterDnsName, createTask);

            if (error)
            {
                if (config.CleanupOnError)
                {
                    Logger.InfoFormat("{0} - {1}. Submitting a delete request for the failed cluster creation.", Config.ConfigName.CleanupOnError.ToString(), config.CleanupOnError.ToString());
                    Delete(resourceGroupName, clusterDnsName);
                }
                else
                {
                    throw new ApplicationException(String.Format("Cluster: {0} - Creation unsuccessful", clusterDnsName));
                }
            }
            else
            {
                if (config.AutoEnableRdp && clusterCreateParameters.OSType == OSType.Windows)
                {
                    HDInsightManagementCLIHelpers.CreateRdpFile(clusterDnsName, config.RdpUsername, config.RdpPassword);
                }
            }
        }
        public static void Write(OperatingSystemType clusterOperatingSystemType, string filePath, List<Object> logEntities)
        {
            if (File.Exists(filePath))
            {
                File.Delete(filePath);
            }

            var excelPackageLogs = new ExcelPackage(new FileInfo(filePath));
            List<MemberInfo> columnInfoBuilds;

            var excelWorksheetHadoopServiceLogs = CreateExcelWorksheetForDataList(excelPackageLogs, "HadoopServiceLog", logEntities, out columnInfoBuilds);

            if (columnInfoBuilds != null && columnInfoBuilds.Count > 0)
            {
                CreateExcelPivotForWorksheet(excelPackageLogs, excelWorksheetHadoopServiceLogs, "ComponentLogTypePivot",
                    new List<PivotField>() { new PivotField("Role") },
                    new List<PivotField>() { new PivotField("ComponentName") },
                    new List<PivotField>() { new PivotField("TraceLevel") },
                    new List<PivotDataField>() { new PivotDataField("Message", "Count", DataFieldFunctions.Count) },
                    logEntities.Count, columnInfoBuilds.Count
                    );
            }
            excelPackageLogs.Save();
        }