private void PersistSettings()
        {
            if (_settingsProvider == null)
            {
                return;
            }

            try
            {
                _settingsProvider.WriteBytes("StoredGroups", ProjectGroup.Serialize(Groups.ToArray()));
            }
            catch (Exception e)
            {
                Debug.WriteLine("Loading Start Page settings failed {0}", e);
            }

            _settingsProvider.WriteInt32("GroupColumns", GroupColumns);
            _settingsProvider.WriteInt32("ProjectColumns", ProjectColumns);
        }
示例#2
0
 public static byte[] Serialize(ProjectGroup[] groups)
 {
     var formatter = new DataContractSerializer(typeof (ProjectGroup[]));
     using (var ms = new MemoryStream())
     {
         formatter.WriteObject(ms, groups);
         return ms.ToArray();
     }
 }