Ejemplo n.º 1
0
        /// <summary>
        /// Handles the conversion of Objects (both MagicTypes and DotNet) into the specified type.
        /// It works only for an ExpVal object (for MagicType) or a DotNet object.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="dotNetType"></param>
        /// <returns></returns>
        public static Object doCast(Object obj, Type dotNetType)
        {
            Object objToCast;
            Object castedObj = null;

            try
            {
                if (GuiExpressionEvaluator.isExpVal(obj))
                {
                    objToCast = GuiExpressionEvaluator.convertExpValToDotNet(obj, dotNetType);
                }
                else
                {
                    objToCast = obj;
                }

                castedObj = ReflectionServices.DynCast(objToCast, dotNetType);
            }
            catch (Exception exception)
            {
                DNException dnException = Manager.GetCurrentRuntimeContext().DNException;
                dnException.set(exception);
                throw dnException;
            }

            return(castedObj);
        }
 /// <summary>
 /// contructor
 /// </summary>
 /// <param name="dataViewOutputCommand"></param>
 public RemoteDataViewToDataSourceCommand(DataViewOutputCommand dataViewOutputCommand)
     : base(dataViewOutputCommand)
 {
     this.dataViewOutputCommand = dataViewOutputCommand;
     currTask     = (TaskBase)MGDataCollection.Instance.GetTaskByID(dataViewOutputCommand.TaskTag);
     ancestorTask = GuiExpressionEvaluator.GetContextTask((TaskBase)currTask, dataViewOutputCommand.Generation);
     destinationDataSourceDefinition = ClientManager.Instance.LocalManager.ApplicationDefinitions.DataSourceDefinitionManager.GetDataSourceDefinition(ancestorTask.getCtlIdx(), dataViewOutputCommand.DestinationDataSourceNumber);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="command"></param>
        public LocalDataViewOutputCommandBase(DataViewOutputCommand dataViewOutputCommand)
            : base(dataViewOutputCommand)
        {
            command = dataViewOutputCommand;

            Task currtask = (Task)MGDataCollection.Instance.GetTaskByID(dataViewOutputCommand.TaskTag);

            task = (Task)GuiExpressionEvaluator.GetContextTask((TaskBase)currtask, dataViewOutputCommand.Generation);
        }