Beispiel #1
0
 public void EndEdit()
 {
     if (!inEdit)
     {
         return;
     }
     inEdit = false;
     bakUniverse = null;
     Memorize();
 }
Beispiel #2
0
 public UniverseVM(Universe universe)
 {
     this.universe = universe;
     this.bakUniverse = null;
 }
Beispiel #3
0
 protected static string ToString(Universe universe)
 {
     return universe.Title + ": " + universe.Memo;
 }
Beispiel #4
0
 public void BeginEdit()
 {
     if (inEdit)
     {
         return;
     }
     inEdit = true;
     bakUniverse = universe.Clone() as Universe;
 }
Beispiel #5
0
 protected static void SetupUniverse(string str, Universe universe)
 {
     List<string> elems = str.Split(':').Select(p => p.Trim()).ToList();
     if (elems.Count != 2)
     {
         return;
     }
     string title = elems[0];
     string memo = elems[1];
     if (!string.IsNullOrEmpty(title))
     {
         universe.Title = title;
     }
     if (!string.IsNullOrEmpty(memo))
     {
         universe.Memo = memo;
     }
 }
Beispiel #6
0
 private Universe CloneUniverse(Universe orgUniverse)
 {
     Universe newUniverse = (Universe)orgUniverse.Clone();
     newUniverse.Id = IDUtils.NewGuid();
     return newUniverse;
 }
Beispiel #7
0
        public static Universe FindMainUniverse(List <Sampling> samplings)
        {
            List <Universe> universes = GetUniverses(samplings);

            return(Universe.FindMainUniverse(universes));
        }
Beispiel #8
0
        public static Universe CreateUniverse(XElement universeElem)
        {
            string id = (string)universeElem.Attribute(ATTR_ID);
            if (id == null)
            {
                return null;
            }

            Universe universe = new Universe();
            universe.Id = id;

            universe.Title = (string)universeElem.Element(r + TAG_LABEL);
            universe.Memo = (string)universeElem.Element(c + TAG_HUMAN_READABLE);

            return universe;
        }
Beispiel #9
0
 private static List<Universe> CreateUniversesPerTab(List<XElement> universeElemList, ref int index, List<string> samplingMethodsPerTab)
 {
     List<Universe> universes = new List<Universe>();
     foreach (string samplingMethod in samplingMethodsPerTab)
     {
         if (index > universeElemList.Count - 1)
         {
             break;
         }
         XElement universeElem = universeElemList[index++];
         Universe universe = new Universe() { Method = samplingMethod };
         SetupUniverse(universeElem.Value, universe);
         universes.Add(universe);
     }
     return universes;
 }