예제 #1
0
        /// <summary>
        /// copy a relationship
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btCopyRel_Click(object sender, RoutedEventArgs e)
        {
            //get the selected item
            if (lbRelations.SelectedItem == null)
            {
                return;
            }
            IRelationshipMetadata copy = lbRelations.SelectedItem as IRelationshipMetadata;

            //create the new item
            IRelationshipMetadata rel = new RelationshipMetadata(Catalog.CatalogMetadata);

            BermudaConfigUtil.CopyRelationship(copy, rel);

            //open the window
            RelationshipConfig window = new RelationshipConfig(rel, "");
            var ret = window.ShowDialog();

            if (!ret.HasValue || ret == false)
            {
                return;
            }

            //add to list
            Relationships.Add(rel);
            Catalog.CatalogMetadata.Relationships.Add(rel.RelationshipName, rel);
        }
예제 #2
0
        /// <summary>
        /// new realtionship
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btNewRel_Click(object sender, RoutedEventArgs e)
        {
            //create the new item
            IRelationshipMetadata rel = new RelationshipMetadata(Catalog.CatalogMetadata);

            //open the window
            RelationshipConfig window = new RelationshipConfig(rel, "");
            var ret = window.ShowDialog();

            if (!ret.HasValue || ret == false)
            {
                return;
            }

            //add to list
            Relationships.Add(rel);
            Catalog.CatalogMetadata.Relationships.Add(rel.RelationshipName, rel);
        }
예제 #3
0
        /// <summary>
        /// double click on relationship for edit
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lbRealtions_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var item = sender as ListBoxItem;

            if (item == null || !item.IsSelected)
            {
                return;
            }
            IRelationshipMetadata sel          = item.Content as IRelationshipMetadata;
            IRelationshipMetadata relationship = new RelationshipMetadata(Catalog.CatalogMetadata);

            BermudaConfigUtil.CopyRelationship(sel, relationship);
            RelationshipConfig window = new RelationshipConfig(relationship, relationship.RelationshipName);
            var ret = window.ShowDialog();

            if (!ret.HasValue || ret.Value == false)
            {
                return;
            }
            BermudaConfigUtil.CopyRelationship(relationship, sel);
            lbRelations.Items.Refresh();
        }
예제 #4
0
        /// <summary>
        /// copy a relationship
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btCopyRel_Click(object sender, RoutedEventArgs e)
        {
            //get the selected item
            if (lbRelations.SelectedItem == null) return;
            IRelationshipMetadata copy = lbRelations.SelectedItem as IRelationshipMetadata;

            //create the new item
            IRelationshipMetadata rel = new RelationshipMetadata(Catalog.CatalogMetadata);
            BermudaConfigUtil.CopyRelationship(copy, rel);

            //open the window
            RelationshipConfig window = new RelationshipConfig(rel, "");
            var ret = window.ShowDialog();
            if (!ret.HasValue || ret == false)
                return;

            //add to list
            Relationships.Add(rel);
            Catalog.CatalogMetadata.Relationships.Add(rel.RelationshipName, rel);
        }
예제 #5
0
        /// <summary>
        /// new realtionship
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btNewRel_Click(object sender, RoutedEventArgs e)
        {
            //create the new item
            IRelationshipMetadata rel = new RelationshipMetadata(Catalog.CatalogMetadata);

            //open the window
            RelationshipConfig window = new RelationshipConfig(rel, "");
            var ret = window.ShowDialog();
            if (!ret.HasValue || ret == false)
                return;

            //add to list
            Relationships.Add(rel);
            Catalog.CatalogMetadata.Relationships.Add(rel.RelationshipName, rel);
        }
예제 #6
0
 /// <summary>
 /// double click on relationship for edit
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lbRealtions_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     var item = sender as ListBoxItem;
     if (item == null || !item.IsSelected) return;
     IRelationshipMetadata sel = item.Content as IRelationshipMetadata;
     IRelationshipMetadata relationship = new RelationshipMetadata(Catalog.CatalogMetadata);
     BermudaConfigUtil.CopyRelationship(sel, relationship);
     RelationshipConfig window = new RelationshipConfig(relationship, relationship.RelationshipName);
     var ret = window.ShowDialog();
     if (!ret.HasValue || ret.Value == false)
         return;
     BermudaConfigUtil.CopyRelationship(relationship, sel);
     lbRelations.Items.Refresh();
 }