[NUI] Add file comment and end empty line
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.XamlBuild / src / public / EXamlBuild / EXaml / EXamlGetObjectByProperty.cs
1 /*
2  * Copyright(c) 2022 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using Mono.Cecil;
18 using System;
19 using System.Collections.Generic;
20 using System.Text;
21 using Tizen.NUI.EXaml.Build.Tasks;
22 using Tizen.NUI.Xaml.Build.Tasks;
23
24 namespace Tizen.NUI.EXaml
25 {
26     //use ``
27     internal class EXamlGetObjectByProperty : EXamlOperation
28     {
29         internal override string Write()
30         {
31             if (instance.IsValid)
32             {
33                 string ret = String.Format("({0} ({1} {2}))\n",
34                          eXamlContext.GetValueString((int)EXamlOperationType.GetObjectByProperty),
35                          eXamlContext.GetValueString(instance.Index),
36                          eXamlContext.GetValueString(propertyName));
37
38                 return ret;
39             }
40             else
41             {
42                 return "";
43             }
44         }
45
46         internal EXamlGetObjectByProperty(EXamlContext context, EXamlCreateObject instance, string propertyName)
47             : base(context)
48         {
49             this.instance = instance;
50             this.propertyName = propertyName;
51             eXamlContext.objectsAccordingToProperty.Add(this);
52
53             eXamlContext.eXamlOperations.Add(this);
54         }
55
56         private EXamlCreateObject instance;
57         private string propertyName;
58     }
59 }
60