public void Serialize(MobileOperatorWithMemo mobileOperator, string path,
                              bool withCallsJournal = true, bool withSmsJournal = true)
        {
            MemoMobileOperator memo = mobileOperator.GetMemo(withCallsJournal, withSmsJournal);

            DataContractJsonSerializer serializer = new DataContractJsonSerializer(memo.GetType());

            using (Stream stream = File.Create(path))
            {
                serializer.WriteObject(stream, memo);
            }
        }
        public void Serialize(MobileOperatorWithMemo mobileOperator, string path,
                              bool withCallsJournal = true, bool withSmsJournal = true)
        {
            MemoMobileOperator memo = mobileOperator.GetMemo(withCallsJournal, withSmsJournal);

            XmlSerializer serializer = new XmlSerializer(memo.GetType());

            using (StreamWriter streamWriter = File.CreateText(
                       path))
            {
                serializer.Serialize(streamWriter, memo);
            }
        }