Пример #1
0
        public static SpeckleObject ToSpeckle(this GSALoadCombo dummyObject)
        {
            var newLines   = ToSpeckleBase <GSALoadCombo>();
            var typeName   = dummyObject.GetType().Name;
            var loadCombos = new SortedDictionary <int, GSALoadCombo>();

            foreach (var k in newLines.Keys)
            {
                var p     = newLines[k];
                var combo = new GSALoadCombo()
                {
                    GWACommand = p, GSAId = k
                };
                try
                {
                    combo.ParseGWACommand();
                }
                catch (Exception ex)
                {
                    Initialiser.AppResources.Messenger.CacheMessage(MessageIntent.Display, MessageLevel.Error, typeName, k.ToString());
                    Initialiser.AppResources.Messenger.CacheMessage(MessageIntent.TechnicalLog, MessageLevel.Error, ex, typeName, k.ToString());
                }
                loadCombos.Add(k, combo);
            }

            Initialiser.GsaKit.GSASenderObjects.AddRange(loadCombos.Values.ToList());

            return((loadCombos.Keys.Count > 0) ? new SpeckleObject() : new SpeckleNull());
        }
Пример #2
0
        public static SpeckleObject ToSpeckle(this GSALoadCombo dummyObject)
        {
            var newLines   = ToSpeckleBase <GSALoadCombo>();
            var loadCombos = new SortedDictionary <int, GSALoadCombo>();
            var keyword    = dummyObject.GetGSAKeyword();

            foreach (var k in newLines.Keys)
            {
                var p     = newLines[k];
                var combo = new GSALoadCombo()
                {
                    GWACommand = p, GSAId = k
                };
                try
                {
                    combo.ParseGWACommand();
                }
                catch (Exception ex)
                {
                    Initialiser.AppResources.Messenger.Message(MessageIntent.TechnicalLog, MessageLevel.Error, ex,
                                                               "Keyword=" + keyword, "Index=" + k);
                }
                loadCombos.Add(k, combo);
            }

            if (loadCombos.Values.Count() > 0)
            {
                Initialiser.GsaKit.GSASenderObjects.AddRange(loadCombos.Values.ToList());
            }

            return((loadCombos.Keys.Count > 0) ? new SpeckleObject() : new SpeckleNull());
        }
        public static SpeckleObject ToSpeckle(this GSALoadCombo dummyObject)
        {
            var newLines = ToSpeckleBase <GSALoadCombo>();

            var loadCombos = new List <GSALoadCombo>();

            foreach (var p in newLines.Values)
            {
                var combo = new GSALoadCombo()
                {
                    GWACommand = p
                };
                combo.ParseGWACommand();
                loadCombos.Add(combo);
            }

            Initialiser.GSASenderObjects[typeof(GSALoadCombo)].AddRange(loadCombos);

            return((loadCombos.Count() > 0) ? new SpeckleObject() : new SpeckleNull());
        }