Ejemplo n.º 1
0
        public Annotation(PedigreeAnnotation annotation)
        {
            InitializeComponent();
            label = annotation.annotation;
            Size labelSize = TextRenderer.MeasureText(label, textFont);
            this.Size = new Size(labelSize.Width, labelSize.Height);
            this.Name = label;

            hraAnnotation = annotation;
        }
Ejemplo n.º 2
0
        public override void BackgroundListLoad()
        {
            //SessionManager.Instance.MetaData.SystemWideDefaultPedigreePrefs.annotations;
            pc.Clear();

            pc.Add("unitnum", unitnum);
            LoadListArgs lla = new LoadListArgs("sp_3_LoadPedigreeAnnotations",
                                                pc,
                                                typeof(PedigreeAnnotation),
                                                constructor_args);

            DoListLoad(lla);

            if (SessionManager.Instance != null)
            {
                lock (SessionManager.Instance.MetaData.SystemWideDefaultPedigreePrefs.annotations)
                {
                    foreach (PedigreeAnnotation sys_default in SessionManager.Instance.MetaData.SystemWideDefaultPedigreePrefs.annotations)
                    {
                        bool found = false;
                        foreach (PedigreeAnnotation local in this)
                        {
                            if (sys_default.annotation == local.annotation)
                            {
                                found = true;
                            }
                        }
                        if (found == false)
                        {
                            PedigreeAnnotation new_pa = new PedigreeAnnotation(unitnum);
                            new_pa.annotation = sys_default.annotation;
                            new_pa.area       = sys_default.area;
                            new_pa.slot       = sys_default.slot;
                            this.Add(new_pa);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public PedigreeAnnotationList CopyAnnotations()
 {
     string unit = annotations.GetUnitnum();
     PedigreeAnnotationList retval = new PedigreeAnnotationList(unit);
     foreach (PedigreeAnnotation pa in annotations)
     {
         PedigreeAnnotation newPa = new PedigreeAnnotation(unit);
         newPa.annotation = pa.annotation;
         newPa.area = pa.area;
         newPa.slot = pa.slot;
         retval.Add(newPa);
     }
     retval.IsLoaded = true;
     return retval;
 }
Ejemplo n.º 4
0
        public void SetPedigreeAnnotation(PedigreeAnnotation pa)
        {
            Annotation a = null;
            foreach (AnnotationContainer ac in annotation_areas)
            {
                bool found = false;
                foreach (AnnotationContainerSlot acs in ac.slots)
                {
                    if (acs.resident != null)
                    if (acs.resident.label == pa.annotation)
                    {
                        if (acs.resident.hraAnnotation != pa)
                        {
                            acs.resident.hraAnnotation = pa;

                        }

                        a = acs.resident;
                        break;
                    }
                }
                if (found)
                    break;
            }
            if (a != null)
            {
                foreach (AnnotationContainer ac in annotation_areas)
                {
                    if (ac.area == pa.area)
                    {
                        if (a.StartingContainer != ac)
                        {
                            ac.AddAnnotation(a);
                            a.hraAnnotation.area = ac.area;
                        }
                    }
                    else
                    {
                        ac.RemoveAnnotation(a);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public override void BackgroundListLoad()
        {
            //SessionManager.Instance.MetaData.SystemWideDefaultPedigreePrefs.annotations;
            pc.Clear();

            pc.Add("unitnum", unitnum);
            LoadListArgs lla = new LoadListArgs("sp_3_LoadPedigreeAnnotations",
                                                pc,
                                                typeof(PedigreeAnnotation),
                                                constructor_args);
            DoListLoad(lla);

            if (SessionManager.Instance != null)
            {
                lock (SessionManager.Instance.MetaData.SystemWideDefaultPedigreePrefs.annotations)
                {
                    foreach (PedigreeAnnotation sys_default in SessionManager.Instance.MetaData.SystemWideDefaultPedigreePrefs.annotations)
                    {
                        bool found = false;
                        foreach (PedigreeAnnotation local in this)
                        {
                            if (sys_default.annotation == local.annotation)
                                found = true;
                        }
                        if (found == false)
                        {
                            PedigreeAnnotation new_pa = new PedigreeAnnotation(unitnum);
                            new_pa.annotation = sys_default.annotation;
                            new_pa.area = sys_default.area;
                            new_pa.slot = sys_default.slot;
                            this.Add(new_pa);
                        }
                    }
                }
            }
        }