Beispiel #1
0
        internal void Initialize(IWebActivity activity)
        {
            // -- NEW ;)

            Activity     = activity;
            ActivityName = activity.ServiceName;

            var activeDataList = string.Empty;

            if (DataListSingleton.ActiveDataList != null)
            {
                activeDataList = DataListSingleton.DataListAsXmlString;
            }

            ActivityDataMappingBuilder ioBuilder = new ActivityDataMappingBuilder
            {
                DataList = activeDataList,
            };

            ioBuilder.SetupActivityData(activity);

            var mappingData = ioBuilder.Generate();

            // save model data
            //Outputs = mappingData.Outputs.ToObservableCollection();
            foreach (var ioViewModel in mappingData.Outputs)
            {
                Outputs.Add(ioViewModel);
            }
            //Inputs = mappingData.Inputs.ToObservableCollection();
            foreach (var ioViewModel in mappingData.Inputs)
            {
                Inputs.Add(ioViewModel);
            }

            // update special fields on the model?!
            var toSaveOutputMapping = ioBuilder.SavedOutputMapping;
            var toSaveInputMapping  = ioBuilder.SavedInputMapping;

            XmlOutput = toSaveOutputMapping;
            Activity.SavedOutputMapping = toSaveOutputMapping;
            Activity.LiveOutputMapping  = toSaveOutputMapping;

            XmlOutput = (XmlOutput + toSaveInputMapping);
            Activity.SavedInputMapping = toSaveInputMapping;
            Activity.LiveInputMapping  = toSaveInputMapping;
        }
Beispiel #2
0
        internal void Initialize(IWebActivity activity)
        {
            Activity     = activity;
            ActivityName = activity.ServiceName;

            var activeDataList = string.Empty;

            if (DataListSingleton.ActiveDataList != null)
            {
                activeDataList = DataListSingleton.DataListAsXmlString;
            }

            var ioBuilder = new ActivityDataMappingBuilder
            {
                DataList = activeDataList,
            };

            ioBuilder.SetupActivityData(activity);

            var mappingData = ioBuilder.Generate();

            foreach (var ioViewModel in mappingData.Outputs)
            {
                Outputs.Add(ioViewModel);
            }
            foreach (var ioViewModel in mappingData.Inputs)
            {
                Inputs.Add(ioViewModel);
            }
            var toSaveOutputMapping = ioBuilder.SavedOutputMapping;
            var toSaveInputMapping  = ioBuilder.SavedInputMapping;

            XmlOutput = toSaveOutputMapping;
            Activity.SavedOutputMapping = toSaveOutputMapping;
            Activity.LiveOutputMapping  = toSaveOutputMapping;

            XmlOutput = XmlOutput + toSaveInputMapping;
            Activity.SavedInputMapping = toSaveInputMapping;
            Activity.LiveInputMapping  = toSaveInputMapping;
        }