示例#1
0
        public static RDMPCollection?GetToolboxFromPersistString(string persistString)
        {
            var helper = new PersistStringHelper();
            var s      = persistString.Substring(PersistableToolboxDockContent.Prefix.Length + 1);

            var args = helper.LoadDictionaryFromString(s);

            RDMPCollection collection;

            if (args.ContainsKey("Toolbox"))
            {
                Enum.TryParse(args["Toolbox"], true, out collection);
                return(collection);
            }

            return(null);
        }
示例#2
0
        public static HistoryEntry Deserialize(string s, IRDMPPlatformRepositoryServiceLocator locator)
        {
            var e = new HistoryEntry();

            try
            {
                var helper = new PersistStringHelper();
                e.Date = DateTime.Parse(helper.GetExtraText(s));

                var objectString = s.Substring(0, s.IndexOf(PersistStringHelper.ExtraText));


                e.Object = helper.GetObjectCollectionFromPersistString(objectString, locator).Single();
            }
            catch (PersistenceException)
            {
                return(null);
            }

            return(e);
        }
示例#3
0
        public string Serialize()
        {
            var helper = new PersistStringHelper();

            return(helper.GetObjectCollectionPersistString(Object) + PersistStringHelper.ExtraText + Date);
        }