Beispiel #1
0
 public DerivedGameAttribute(string name) : base(name)
 {
     ValueExpression = new AttributeText(this);
 }
Beispiel #2
0
 public async Task UpdateAsync(AttributeText item)
 {
     await _repository.UpdateAsync(item);
 }
Beispiel #3
0
 public async Task DeleteAsync(AttributeText item)
 {
     await _repository.DeleteAsync(item);
 }
Beispiel #4
0
        public async Task <int> InsertAsync(AttributeText item)
        {
            await _repository.AddAsync(item);

            return(item.Id);
        }
	private static MethodDeclaration CreateMaterializeCommandMethod (string templateFilePath, string commandName)
	{
		string templateName = Path.GetFileNameWithoutExtension (templateFilePath).Replace ('.', '_').Replace (' ', '_');
		StringBuilder methodBody = new StringBuilder ();
#if VERBOSE_LOG
		methodBody.Append (InvocationHelper.CreateMethodInvocation<object> (Debug.Log, "\"" + templateFilePath + "\"")).AppendLine (";");
#endif
		methodBody.Append (InvocationHelper.CreateMethodInvocation<string> (GenerateCode, templateFilePath)).AppendLine (";");
		// public static void CreateHoge() {}
		MethodDeclaration method = new MethodDeclaration () { Name = "Create" +  templateName};
		method.MethodBody = methodBody.ToString ();
		method.ModifierList.Add (Modifier.Pubic);
		method.ModifierList.Add (Modifier.Static);
		// method attribute [MenuItem("hoge", false, 90)]
		AttributeText attribute = new AttributeText () { Name = typeof(MenuItem).Name};
		string commandText = string.IsNullOrEmpty (commandName) ? templateName : commandName;
		attribute.ParameterList.Add (MaterializeCommandPrefix + "/" + commandText);
		attribute.ParameterList.Add (false);
		attribute.ParameterList.Add (MaterializeCommandPriority);
		method.AttributeList.Add (attribute);
		return method;
	}