Example #1
0
        public const double RELDEFWND_INI_HEIGHT = 715; // 720;

        public static void SetRelationshipDefinitionsMaintainer(ItemsGridMaintainer <Domain, RelationshipDefinition> TargetMaintainer)
        {
            TargetMaintainer.CreateItemOperation = RelationshipDefinitionCreate;
            TargetMaintainer.DeleteItemOperation = RelationshipDefinitionDelete;
            TargetMaintainer.EditItemOperation   = RelationshipDefinitionEdit;
            TargetMaintainer.CloneItemOperation  = RelationshipDefinitionClone;
        }
Example #2
0
 public static void SetConceptDefClustersMaintainer(ItemsGridMaintainer <Domain, FormalPresentationElement> TargetMaintainer)
 {
     TargetMaintainer.CreateItemOperation = ConceptDefClusterCreate;
     TargetMaintainer.DeleteItemOperation = ConceptDefClusterDelete;
     TargetMaintainer.EditItemOperation   = ConceptDefClusterEdit;
     TargetMaintainer.CloneItemOperation  = ConceptDefClusterClone;
 }
Example #3
0
 public static void SetExternalLanguagesMaintainer(ItemsGridMaintainer <Domain, ExternalLanguageDeclaration> TargetMaintainer)
 {
     TargetMaintainer.CreateItemOperation = ExternalLanguageCreate;
     TargetMaintainer.DeleteItemOperation = ExternalLanguageDelete;
     TargetMaintainer.EditItemOperation   = ExternalLanguageEdit;
     TargetMaintainer.CloneItemOperation  = ExternalLanguageClone;
 }
        public void SetSourceTableDef(TableDefinition SourceTableDef)
        {
            if (this.SourceTableDef == SourceTableDef)
            {
                return;
            }

            this.SourceTableDef = SourceTableDef;

            // Set working data sources
            this.WorkingFieldDefs         = SourceTableDef.FieldDefinitions;
            this.WorkingUniqueKeyFields   = SourceTableDef.UniqueKeyFieldDefs;
            this.WorkingDominantRefFields = SourceTableDef.DominantRefFieldDefs;
            this.WorkingLabelFields       = SourceTableDef.LabelFieldDefs;

            // Remove previous assignments
            if (this.FieldsMaintainer != null)
            {
                this.FieldsMaintainer.ItemDeleted -= FieldsMaintainer_ItemDeleted;
            }

            // Set editing controls
            this.FieldsMaintainer = ItemsGridMaintainer.CreateItemsGridControl(SourceTableDef, WorkingFieldDefs,
                                                                               null /*- UNNECESSARY DUE TO DEEP-CLONNING: (item) => ProductDirector.ConfirmImmediateApply("Table Fields Definition", "DomainEdit.TableFieldsDefinition",
                                                                                     *                                         "ApplyTypingChangesDirectly", "This text-box")*/);
            this.FieldsMaintainer.ItemDeleted += FieldsMaintainer_ItemDeleted;

            this.BrdFields.Child = this.FieldsMaintainer.VisualControl;

            this.LstbxUniqueKeyFields.ItemsSource = this.WorkingUniqueKeyFields;
            this.LstbxDominantFields.ItemsSource  = this.WorkingDominantRefFields;
            this.LstbxLabelFields.ItemsSource     = this.WorkingLabelFields;

            // PENDING: Establish drag-drop behavior
        }
Example #5
0
 public static void SetFieldDefinitionsMaintainer(ItemsGridMaintainer <TableDefinition, FieldDefinition> TargetMaintainer)
 {
     TargetMaintainer.CreateItemOperation = FieldDefinitionCreate;
     TargetMaintainer.DeleteItemOperation = FieldDefinitionDelete;
     TargetMaintainer.EditItemOperation   = FieldDefinitionEdit;
     TargetMaintainer.CloneItemOperation  = FieldDefinitionClone;
 }
Example #6
0
 public static void SetVariantDefinitionsMaintainer(ItemsGridMaintainer <Domain, SimplePresentationElement> TargetMaintainer)
 {
     TargetMaintainer.CreateItemOperation = VariantDefinitionCreate;
     TargetMaintainer.DeleteItemOperation = VariantDefinitionDelete;
     TargetMaintainer.EditItemOperation   = VariantDefinitionEdit;
     TargetMaintainer.CloneItemOperation  = VariantDefinitionClone;
 }
Example #7
0
        // ---------------------------------------------------------------------------------------------------------------------------------------------------------------
        public Tuple <Action <TableRecord>, Action> SetMultiRecordEditor()
        {
            // Create columns
            var ColDefs = new List <Tuple <IIdentifiableElement, DataGridColumn> >();

            foreach (var FieldDef in this.SourceTable.Definition.FieldDefinitions)
            {
                ColDefs.Add(Tuple.Create <IIdentifiableElement, DataGridColumn>(FieldDef, CreateGridColumn(FieldDef, this.SourceTable.OwnerIdea.OwnerComposition)));
            }

            // Call the control creator.
            this.MultiRecordMaintainer = ItemsGridMaintainer.CreateItemsGridMaintainer(this.SourceTable, this.SourceTable, null, ColDefs.ToArray());
            this.MultiRecordMaintainer.CreateItemOperation = ((ownent, edlist) => new TableRecord(this.SourceTable));
            this.MultiRecordMaintainer.CloneItemOperation  = ((ownent, edlist, tblrec) => tblrec.CreateClone(ECloneOperationScope.Deep, null));
            this.MultiRecordMaintainer.DeleteItemOperation = ((ownent, edlist, tblrec) => true);
            this.MultiRecordMaintainer.EditItemOperation   = null;
            this.MultiRecordMaintainer.VisualControl.EditEndingOperation = this.ReactToFieldEditEnding;

            /*? ((tblrec) =>
             *  {
             *      Console.WriteLine("Label: [{0}]", tblrec.Label);
             *      return Display.DialogMessage("PENDING...", "Edit this user-defined Table Record!").IsTrue();
             *  }); */

            this.MultiRecordMaintainer.VisualControl.Loaded += MultiRecordEditor_Loaded;

            this.BackPanel.Children.Clear();
            this.BackPanel.Children.Add(this.MultiRecordMaintainer.VisualControl);

            return(Tuple.Create <Action <TableRecord>, Action>((record) => this.MultiRecordMaintainer.AppendRecord(record),
                                                               () => this.MultiRecordMaintainer.ResetRecords()));
        }