'C# 및 XAML로 Windows 8 용 응용 프로그램 만들기.컴파일러에서 메서드 이름을 찾을 수 없습니다
나는 AppNamespace라는 네임 스페이스 내에서 두 개의 클래스를 정의했다,이 클래스 중 하나는 그것의 생성자 내에서 세 가지 차원 부울 배열을 :
public class Solver
{
// Board is a class also in this namespace but I don't think the issue is
//there, so I've omitted it's definition
private Board current;
// You can see that the class clearly DOES take a parameter of the same type
// as the array "content" (which is defined later)
public Solver (bool[, ,] initial)
{
// The parameter is then used to construct a "Board" class within the
// "Solver" class.
current = new Board(initial);
}
// Several methods within the class
}
그래서 정의는 위에서 볼 수 있습니다.
그러면 'NewPage.xaml'이라는 gridapp에 새 페이지를 만들고 그 페이지에 배열 내의 값을 조작하는 일부 텍스트 상자가 있습니다. (여기서 문제가되지 않는 것 같습니다)
버튼을 클릭하면 'NewPage.xaml.cs'에서 클래스에 인스턴스를 생성하고 클래스 내에서 메소드를 실행해야합니다. 아래와 같이 "NewPage.xaml.cs"의 상단 I는 세 가지 차원 배열을 정의
// Declare the namespace where the class "Solver" is situated
using App.Classes;
namespace App
{
// So below is the C# part of the page "PuzzleSolver"
public sealed partial class PuzzleSolver : App.Common.LayoutAwarePage
{
// Create an array called content
bool[, ,] content = new bool[9, 9, 9];
public PuzzleSolver()
{
this.InitializeComponent();
//Set every cell of the created content array to true
for (int i = 0; i <= 8; i++)
{
for (int j = 0; j <= 8; j++)
{
for (int k = 0; k <= 8; k++)
{
content[i, j, k] = true;
}
}
}
}
/* There are some methods which change information in the array "Content" based on the
stuff input into the XAML textboxes on the page. */
// The below method is invoked when a XAML Button is clicked on the page
// and I intend it to create a "Solver" object, using the "content" array
// from this page as a parameter
private void Button_Click_1(object sender, RoutedEventArgs e)
{
// So now I create the and pass in the "content" array
Solver newSolve = new Solver(content);
newSolve.Solve();
}
}
문제는 컴파일러가 "클래스 이름은"클래스임을 인식이지만, 그렇지 않은 것을 말한다 1 매개 변수를 사용하는 생성자가 있고 또한 다음과 같이 말합니다 :
"ProjectName.className에"met HOD 및 은 더 확장 방법은 ProjectName.className를 볼 수 있습니다 유형 의 첫 번째 인수를 받아들이는 "방법"(당신은 사용 지시문 또는 어셈블리 참조가 "실종되지
내 문제는이 정보를 어디에서 사람이 식별 할 수 ?
나는이 다른 네임 스페이스 선언, "Solver.xaml.cs"에 먼저 선언을 보여주기 위해 편집 한 :
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using App.Classes;
이제 선언을 "Solver.xaml"에 :
<common:LayoutAwarePage
x:Name="pageRoot"
x:Class="App.Solver"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App"
xmlns:common="using:App.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<x:String x:Key="PageName">Solver</x:String>
</Page.Resources>
className 정의에 정의 된 method()가 표시되지 않습니다. 전화하려는 방법이 있는지 확인하십시오. –
'3 차원 부울 배열'- 내 머리가 아파요 .-) – leon
@ScottChapman 죄송합니다. 예, 메소드를 정의했지만 클래스 자체가 너무 길고 복잡하기 때문에 그 내용을 버렸습니다.하지만 문제는 아니라고 생각했습니다. 이것이 C#과 함께 할 것인가? – GArchitech