Пример #1
0
 /// <summary>
 /// Crea un EditListFormControl basado en un ListFormSilverlight.
 /// </summary>
 /// <param name="showDataFormSilverlight">ShowDataFormSilverlight usado para  crearlo.</param>
 /// <param name="dataModel">Modelo de datos usado para completar los datos de la interfaz.</param>
 public EditShowDataFormControl(ShowDataFormSilverlight showDataFormSilverlight, DataModel dataModel)
 {
     // Inicializar variables.
     InitializeComponent();
     this.tempSingleItems               = new List <TextField>();
     this.showDataFormSilverlight       = showDataFormSilverlight;
     this.canvasDraw.MouseLeftButtonUp += new MouseButtonEventHandler(canvasDraw_MouseLeftButtonUp);
 }
Пример #2
0
 private void buttonDisplayData_Clicked(object sender, EventArgs e)
 {
     try
     {
         isMakeConnectionAction = false;
         ShowDataFormSilverlight showDataFormSilverlight = new ShowDataFormSilverlight();
         showDataFormSilverlight.ChangeTitle(SilverlightVisualDesigners.Properties.Resources.ShowDataFormName + " " + numberOfForms);
         numberOfForms++;
         Builder(showDataFormSilverlight);
         serviceDocument.AddWidget(showDataFormSilverlight.ShowDataForm);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #3
0
        private void LoadServiceData(ServiceDocument serviceDocument)
        {
            Dictionary <Component, IConnection> widgetEquivalences = new Dictionary <Component, IConnection>();

            foreach (Component component in serviceDocument.Components)
            {
                Type type = component.GetType();
                switch (type.Name)
                {
                case "DataSource":
                    DataSource            dataSource            = component as DataSource;
                    DataSourceSilverlight dataSourceSilverlight = new DataSourceSilverlight(dataSource);
                    Builder(dataSourceSilverlight);
                    widgetEquivalences.Add(dataSource, dataSourceSilverlight);
                    break;

                case "ListForm":
                    ListForm            listForm            = component as ListForm;
                    ListFormSilverlight listFormSilverlight = new ListFormSilverlight(listForm);
                    Builder(listFormSilverlight);
                    widgetEquivalences.Add(listForm, listFormSilverlight);
                    break;

                case "ShowDataForm":
                    ShowDataForm            showDataForm            = component as ShowDataForm;
                    ShowDataFormSilverlight showDataFormSilverlight = new ShowDataFormSilverlight(showDataForm);
                    Builder(showDataFormSilverlight);
                    widgetEquivalences.Add(showDataForm, showDataFormSilverlight);
                    break;

                case "EnterSingleDataForm":
                    EnterSingleDataForm            enterSingleDataForm   = component as EnterSingleDataForm;
                    EnterSingleDataFormSilverlight singleDataSilverlight = new EnterSingleDataFormSilverlight(enterSingleDataForm);
                    Builder(singleDataSilverlight);
                    widgetEquivalences.Add(enterSingleDataForm, singleDataSilverlight);
                    break;

                case "MenuForm":
                    MenuForm            menuForm        = component as MenuForm;
                    MenuFormSilverlight menuSilverlight = new MenuFormSilverlight(menuForm);
                    Builder(menuSilverlight);
                    widgetEquivalences.Add(menuForm, menuSilverlight);
                    foreach (MenuItemSilverlight menuItemSilverlight in menuSilverlight.MenuItemsSilverlight)
                    {
                        widgetEquivalences.Add(menuItemSilverlight.FormMenuItem, menuItemSilverlight);
                    }
                    break;

                default:
                    throw new ArgumentException(SilverlightVisualDesigners.Properties.Resources.InvalidTypeOfWidget);
                }
            }

            this.canvasDraw.UpdateLayout();

            foreach (Connection connection in serviceDocument.Connections)
            {
                IConnection from   = widgetEquivalences[connection.Source.Parent];
                IConnection target = widgetEquivalences[connection.Target.Parent];

                ConnectionSilverlight connectionSilverlight = new ConnectionSilverlight(from, target);
                connectionSilverlight.Connection = connection;
                AddRelation(connectionSilverlight);
            }
        }