Beispiel #1
0
 private static void WriteUserData(UserdataFileFormat udf)
 {
     using (FormattedWriter fw = new FormattedWriter("sites.info"))
     {
         fw.Write(udf);
     }
 }
 private static void WriteUserData(UserdataFileFormat udf)
 {
     using (FormattedWriter fw = new FormattedWriter("sites.info"))
     {
         fw.Write(udf);
     }
 }
Beispiel #3
0
        public static UserdataFileFormat Init()
        {
            UserdataFileFormat udf = new UserdataFileFormat();

            udf.numOfEntries = 0;
            udf.entries      = new UserdataEntry[0];
            return(udf);
        }
Beispiel #4
0
        private static UserdataFileFormat ReadUserData()
        {
            UserdataFileFormat udf;

            if (File.Exists("sites.info"))
            {
                using (FormattedReader fr = new FormattedReader("sites.info"))
                {
                    udf = fr.Read <UserdataFileFormat>();
                }
            }
            else
            {
                udf = UserdataFileFormat.Init();
            }
            return(udf);
        }
Beispiel #5
0
        void UpdateFileFromServerList()
        {
            List <UserdataEntry> entries = new List <UserdataEntry>();

            foreach (ServerInfo si in listBox1.Items)
            {
                entries.Add(new UserdataEntry()
                {
                    Name     = si.name,
                    Username = si.username,
                    Password = si.password,
                    URL      = si.conn.URL
                });
            }
            UserdataFileFormat udf = new UserdataFileFormat();

            udf.entries      = entries.ToArray();
            udf.numOfEntries = entries.Count;
            WriteUserData(udf);
        }
 void UpdateFileFromServerList()
 {
     List<UserdataEntry> entries = new List<UserdataEntry>();
     foreach (ServerInfo si in listBox1.Items)
     {
         entries.Add(new UserdataEntry()
         {
             Name = si.name,
             Username = si.username,
             Password = si.password,
             URL = si.conn.URL
         });
     }
     UserdataFileFormat udf = new UserdataFileFormat();
     udf.entries = entries.ToArray();
     udf.numOfEntries = entries.Count;
     WriteUserData(udf);
 }
 public static UserdataFileFormat Init()
 {
     UserdataFileFormat udf = new UserdataFileFormat();
     udf.numOfEntries = 0;
     udf.entries = new UserdataEntry[0];
     return udf;
 }