packages/MvvmLight.5.4.1/tools/install.ps1

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

param($installPath, $toolsPath, $package, $project)

# find the App.xaml file 
$appxaml = $project.ProjectItems | where {$_.Name -eq "App.xaml"}
$appxamlPath = ($appxaml.Properties | where {$_.Name -eq "LocalPath"}).Value

# find the CSPROJ file 
$projectPath = ($project.Properties | where {$_.Name -eq "LocalPath"}).Value + $project.Name + ".csproj"
$namespace = $project.Properties.Item("RootNamespace").Value

# DEBUG ONLY
#$namespace = "Univ"
#$projectPath = "C:\MvvmLight\TEMPO2\AllPlatformsNoVm\Univ\Univ.Windows\Univ.Windows.csproj"
# DEBUG ONLY

$isUniversal = $false
$sharedFolderPath = $null

if ($appxamlPath -eq $null)
{
	# Might be a universal project, try it
	$pathElements = $projectPath.Split('\')
	$appxamlPath = ""
	$lastElement = ""

	for ($i = 0; $i -le $pathElements.Length - 3; $i++)
	{
		$sharedFolderPath += $pathElements[$i] + "/"
		$appxamlPath += $pathElements[$i] + "/"
		$lastElement = $pathElements[$i]
	}
	
	$appxamlPath += $lastElement  + ".Shared/App.xaml"
	
#	[System.Windows.MessageBox]::Show("New appxamlPath " + $appxamlPath, 'TEST', 'OK')

	if (Test-Path $appxamlPath)
	{
		$isUniversal = $true
#		[System.Windows.MessageBox]::Show("UNIVERSAL", 'TEST', 'OK')
	}
	else
	{
		$appxamlPath = $null
	}
}

if ($appxamlPath -eq $null)
{
	# add the required .NET assembly:
	Add-Type -AssemblyName PresentationFramework 
	[System.Windows.MessageBox]::Show('Cannot find App.xaml in this project, no other changes made. If you are installing in a PCL, please use "MVVM Light Libs Only" instead.', 'Warning', 'OK')
}
else
{
	$projectXml = New-Object xml
	$projectXml.Load($projectPath)

	$propertyGroups = $projectXml.SelectNodes("//*") | where { $_.Name -eq "PropertyGroup" }

后面还有 221 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。