Example #1
0
        // To be called upon system startup in order to load display parameters.
        // In fact it would be possible to re-load configuration files during runtime
        // and dynamically change display attributes.
        public static void Load()
        {
            // First populate the DisplayAttributeDataSet with each DisplayItem
            /////////////////////////////////////////////////////////////////////
            //                          IMPORTANT !!!
            // Make sure that items are added in the same sequence as defined in
            // the DisplayItems enumeration. Later on the data is to be retrieved
            // by the name only.

            // Radar 0
            DisplayAttributesType DataItem = new DisplayAttributesType();

            DataItem.ItemName = "Radar";
            DisplayAttributeDataSet.Add(DataItem);
            // Waypoint 1
            DataItem          = new DisplayAttributesType();
            DataItem.ItemName = "Waypoint";
            DisplayAttributeDataSet.Add(DataItem);
            // StateBorder 2
            DataItem          = new DisplayAttributesType();
            DataItem.ItemName = "StateBorder";
            DisplayAttributeDataSet.Add(DataItem);
            // BackgroundColor 3
            DataItem          = new DisplayAttributesType();
            DataItem.ItemName = "BackgroundColor";
            DisplayAttributeDataSet.Add(DataItem);
            // SectorBorder 4
            DataItem          = new DisplayAttributesType();
            DataItem.ItemName = "SectorBorder";
            DisplayAttributeDataSet.Add(DataItem);
            // RunwayBorder 5
            DataItem          = new DisplayAttributesType();
            DataItem.ItemName = "RunwayBorder";
            DisplayAttributeDataSet.Add(DataItem);
        }
Example #2
0
        // Set display attribute
        public static void SetDisplayAttribute(DisplayItemsType Item, DisplayAttributesType Attribute)
        {
            DisplayAttributeDataSet[DisplayItemToIndex(Item)] = Attribute;

            //DisplayAttribute.ItemName = words[0];
            //DisplayAttribute.TextSize = int.Parse(words[1]);
            //DisplayAttribute.TextFont = new FontFamily(words[2]);
            //DisplayAttribute.TextColor = Color.FromName(words[3]);
            //DisplayAttribute.LineWidth = int.Parse(words[4]);
            //DisplayAttribute.LineColor = Color.FromName(words[5]);
            //DisplayAttribute.LineStyle = DashStyle.Solid;
            //DisplayAttribute.AreaPolygonColor = Color.FromName(words[7]);
            //DisplayAttribute.ImageSize = new Size(int.Parse(words[8]), int.Parse((words[9])));

            StaticDisplayBuildRequired = true;
        }
        // To be called upon system startup in order to load display parameters.
        // In fact it would be possible to re-load configuration files during runtime
        // and dynamically change display attributes.
        public static void Load()
        {
            // First populate the DisplayAttributeDataSet with each DisplayItem
            /////////////////////////////////////////////////////////////////////
            //                          IMPORTANT !!!
            // Make sure that items are added in the same sequence as defined in
            // the DisplayItems enumeration. Later on the data is to be retrieved
            // by the name only.

            // Radar 0
            DisplayAttributesType DataItem = new DisplayAttributesType();
            DataItem.ItemName = "Radar";
            DisplayAttributeDataSet.Add(DataItem);
            // Waypoint 1
            DataItem = new DisplayAttributesType();
            DataItem.ItemName = "Waypoint";
            DisplayAttributeDataSet.Add(DataItem);
            // StateBorder 2
            DataItem = new DisplayAttributesType();
            DataItem.ItemName = "StateBorder";
            DisplayAttributeDataSet.Add(DataItem);
            // BackgroundColor 3
            DataItem = new DisplayAttributesType();
            DataItem.ItemName = "BackgroundColor";
            DisplayAttributeDataSet.Add(DataItem);
            // SectorBorder 4
            DataItem = new DisplayAttributesType();
            DataItem.ItemName = "SectorBorder";
            DisplayAttributeDataSet.Add(DataItem);
            // RunwayBorder 5
            DataItem = new DisplayAttributesType();
            DataItem.ItemName = "RunwayBorder";
            DisplayAttributeDataSet.Add(DataItem);
        }
        // Set display attribute
        public static void SetDisplayAttribute(DisplayItemsType Item, DisplayAttributesType Attribute)
        {
            DisplayAttributeDataSet[DisplayItemToIndex(Item)] = Attribute;

            //DisplayAttribute.ItemName = words[0];
            //DisplayAttribute.TextSize = int.Parse(words[1]);
            //DisplayAttribute.TextFont = new FontFamily(words[2]);
            //DisplayAttribute.TextColor = Color.FromName(words[3]);
            //DisplayAttribute.LineWidth = int.Parse(words[4]);
            //DisplayAttribute.LineColor = Color.FromName(words[5]);
            //DisplayAttribute.LineStyle = DashStyle.Solid;
            //DisplayAttribute.AreaPolygonColor = Color.FromName(words[7]);
            //DisplayAttribute.ImageSize = new Size(int.Parse(words[8]), int.Parse((words[9])));

            StaticDisplayBuildRequired = true;
        }