コード例 #1
0
ファイル: Phone.cs プロジェクト: Igor-Rashyn/exercises
 public override string WriteJSON(Diary par)
 {
     return line = Convert.ToString("\"Type\":" + "\"" + par.GetType() + "\"" + "," + "\n" +
                             "\"Id\":"  + "\"" + par.Id + "\"" + "," + "\n" +
                             "\"Name\":" + "\"" + par.Name + "\"" + "," + "\n" +
                             "\"PhoneType\":" + "\"" + ((Phone)par).PhoneType + "\"" + "," + "\n" +
                             "\"PhoneNumber\":" + "\"" + ((Phone)par).PhoneNumber + "\"" + ",");      
 }
コード例 #2
0
ファイル: Card.cs プロジェクト: Igor-Rashyn/exercises
 public override string WriteJSON(Diary par)
 {
     return line = Convert.ToString("\"Type\":"  + "\"" + par.GetType() + "\"" + ","+ "\n" +
                                    "\"Id\":"  + "\"" + par.Id + "\"" + "," + "\n" +
                                    "\"Name\":"  + "\"" + par.Name + "\"" + "," + "\n" +
                                    "\"NameCard\":"  + "\"" + ((Card)par).NameCard + "\"" + "," + "\n" +
                                    "\"NumberCard\":"  + "\"" + ((Card)par).NumberCard + "\"" + ","); 
  }
コード例 #3
0
ファイル: Phone.cs プロジェクト: Igor-Rashyn/exercises
 public override string WriteYAML(Diary par, int i)
 {
     return line = Convert.ToString( "    " + "Type:"      +  par.GetType()          + "\n" +
                                     "    " + "Id:"        +  par.Id                 + "\n" +
                                     "    " + "Name:"      +  par.Name               + "\n" +
                                     "    " + "NameCard:"                            + "\n" +
                                     "    " + "NumberCard:"                          + "\n" +
                                     "    " + "PhoneType:" + ((Phone)par).PhoneType   + "\n" +
                                     "    " + "Phone:"     + ((Phone)par).PhoneNumber + "\n");
 }
コード例 #4
0
ファイル: Phone.cs プロジェクト: Igor-Rashyn/exercises
 public override string WriteXML(Diary par, int i)
 {
     return line = Convert.ToString("<" + "Element id=\"" + i + "\"" + ">" + "\n" +
            "<" + "type" + ">" + par.GetType() + "</" + "type" + ">" + "\n" +
            "<" + "Id" + ">" + par.Id + "</" + "Id" + ">" + "\n" +
            "<" + "Name" + ">" + par.Name + "</" + "Name" + ">" + "\n" +
            "<" + "NameCard" + "/>" + "\n" +
            "<" + "NumberCard" + "/>" + "\n" +
            "<" + "PhoneType" + ">" + ((Phone)par).PhoneType + "</" + "PhoneType" + ">" + "\n" +
            "<" + "PhoneNumber" + ">" + ((Phone)par).PhoneNumber + "</" + "PhoneNumber" + ">" + "\n" +
            "</" + "Element" + ">");
 }
コード例 #5
0
ファイル: Phone.cs プロジェクト: Igor-Rashyn/exercises
 public override string WriteCSV(Diary par)
 {
    return line = Convert.ToString(par.GetType() + "," + par.Id + "," + par.Name + "," + ((Phone)par).PhoneType + "," + ((Phone)par).PhoneNumber);
 }
コード例 #6
0
ファイル: Diary.cs プロジェクト: Igor-Rashyn/exercises
 public virtual string WriteYAML(Diary par, int i) { return line; }
コード例 #7
0
ファイル: Diary.cs プロジェクト: Igor-Rashyn/exercises
 public virtual string WriteJSON(Diary par) { return line; }
コード例 #8
0
ファイル: Diary.cs プロジェクト: Igor-Rashyn/exercises
 public virtual string WriteCSV(Diary par) { return line; }
コード例 #9
0
ファイル: Card.cs プロジェクト: Igor-Rashyn/exercises
 public override string WriteCSV(Diary par)
 {
 return line = Convert.ToString((par.GetType() + "," + par.Id + "," + par.Name + "," + ((Card)par).NameCard + "," + ((Card)par).NumberCard));
 }