Example #1
0
 public void SyncWith(CellMonitor cellMonitor)
 {
     this.PrimaryKeyValue = cellMonitor.PrimaryKeyValue;
     this.ColumnIndex     = cellMonitor.ColumnIndex;
     this.ColumnName      = cellMonitor.ColumnName;
     this.OriginValue     = cellMonitor.OriginValue;
     this.NewValue        = cellMonitor.NewValue;
     this.FireTask        = cellMonitor.FireTask;
 }
Example #2
0
        public object Clone()
        {
            CellMonitor monitor = new CellMonitor(PrimaryKeyValue, ColumnIndex, ColumnName, OriginValue)
            {
                NewValue = NewValue
            };

            if (FireTask != null)
            {
                monitor.FireTask = new HttpFireTask()
                {
                    Url        = FireTask.Url,
                    Data       = FireTask.Data,
                    TypeOfPost = FireTask.TypeOfPost
                };
            }
            return(monitor);
        }
 private async void onExecutableContentMsg(ExecutableContent <CellMonitor> content)
 {
     if (null != content.Value)
     {
         CellMonitor   modify     = (CellMonitor)content.Value.Clone();
         CellMonitor[] parameters = new CellMonitor[] { content.Value, modify };
         ICommand      command    = content.Command;
         var           dialog     = new Epxoxy.Controls.ContentDialog()
         {
             PrimaryButtonText             = "Save changes",
             PrimaryButtonCommand          = command,
             PrimaryButtonCommandParameter = parameters,
             SecondaryButtonText           = "Cancel",
             Title   = "Edit CellMonitor",
             Content = new CellMonitorView()
             {
                 CellMonitor = modify
             }
         };
         await dialog.ShowAsync(contentRoot);
     }
 }
        private async void onEditMonitorClick(object sender, RoutedEventArgs e)
        {
            var menuItem = sender as System.Windows.Controls.MenuItem;

            if (menuItem != null)
            {
                CellMonitor monitor = menuItem.CommandParameter as CellMonitor;
                if (monitor != null)
                {
                    CellMonitor   editItem    = (CellMonitor)monitor.Clone();
                    CellMonitor[] parameters  = new CellMonitor[] { monitor, editItem };
                    ICommand      saveCommand = menuItem.Tag as ICommand;
                    var           dialog      = new Epxoxy.Controls.ContentDialog()
                    {
                        PrimaryButtonText             = "Save changes",
                        PrimaryButtonCommand          = saveCommand,
                        PrimaryButtonCommandParameter = parameters,
                        SecondaryButtonText           = "Cancel",
                        Title   = "Edit CellMonitor",
                        Content = new CellMonitorView()
                        {
                            CellMonitor = editItem
                        }
                    };
                    await dialog.ShowAsync(this.Content as FrameworkElement);
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("CellMonitor null");
                }
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("ICommandSource null");
            }
        }