예제 #1
0
        public static SpeckleObject ToSpeckle(this GSALoadTask dummyObject)
        {
            var newLines  = ToSpeckleBase <GSALoadTask>();
            var typeName  = dummyObject.GetType().Name;
            var loadTasks = new List <GSALoadTask>();

            foreach (var k in newLines.Keys)
            {
                var p    = newLines[k];
                var task = new GSALoadTask()
                {
                    GWACommand = p, GSAId = k
                };
                try
                {
                    task.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());
                }
                loadTasks.Add(task);
            }

            Initialiser.GsaKit.GSASenderObjects.AddRange(loadTasks);

            return((loadTasks.Count() > 0) ? new SpeckleObject() : new SpeckleNull());
        }
        public static SpeckleObject ToSpeckle(this GSALoadTask dummyObject)
        {
            var newLines  = ToSpeckleBase <GSALoadTask>();
            var loadTasks = new List <GSALoadTask>();
            var keyword   = dummyObject.GetGSAKeyword();

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

            if (loadTasks.Count() > 0)
            {
                Initialiser.GsaKit.GSASenderObjects.AddRange(loadTasks);
            }

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

            var loadTasks = new List <GSALoadTask>();

            foreach (var p in newLines.Values)
            {
                var task = new GSALoadTask()
                {
                    GWACommand = p
                };
                task.ParseGWACommand();
                loadTasks.Add(task);
            }

            Initialiser.GSASenderObjects.AddRange(loadTasks);

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