Beispiel #1
0
        private void ChangeAccessRecordFor(ComponentManagerType _type)
        {
            if (this.ComponentToDisplay == null)
            {
                return;
            }

            foreach (var child in this.Children)
            {
                StackPanel sp = child as StackPanel;
                if (sp == null)
                {
                    continue;
                }
                if (sp.Tag == null)
                {
                    continue;
                }
                if (!(sp.Tag is ComponentManagerType))
                {
                    continue;
                }

                ComponentManagerType sp_type = (ComponentManagerType)sp.Tag;
                if (sp_type != _type)
                {
                    continue;
                }

                string     access             = ComponentUtils.COMP_ACCESS_NONE;
                char[]     access_chars       = access.ToCharArray();
                DateTime[] access_time_stamps = new DateTime[4];

                foreach (var sp_child in sp.Children)
                {
                    TextBlockDoubleText sp_tb = sp_child as TextBlockDoubleText;
                    if (sp_tb == null)
                    {
                        continue;
                    }
                    if (sp_tb.Tag == null)
                    {
                        continue;
                    }
                    if (!(sp_tb.Tag is ComponentManagerAndAccessFlagDateTimeTriple))
                    {
                        continue;
                    }

                    ComponentManagerAndAccessFlagDateTimeTriple info = (ComponentManagerAndAccessFlagDateTimeTriple)sp_tb.Tag;
                    access_chars[info.AccessFlagIndex]       = sp_tb.Text.ToCharArray()[0];
                    access_time_stamps[info.AccessFlagIndex] = info.AccessTimeStamp_Current;
                }
                // set the ACCESS TYPE
                access = new string(access_chars);
                ComponentAccessType access_type = ComponentUtils.StringToComponentAccessType(access);

                ComponentAccessTracker tracker = this.ComponentToDisplay.AccessLocal[sp_type];
                tracker.AccessTypeFlags = access_type;
                // set the TIME STAMPS
                for (int t = 0; t < 4; t++)
                {
                    tracker.SetTimeStamp(t, access_time_stamps[t]);
                }
                this.ComponentToDisplay.AccessLocal[sp_type] = tracker;

                break;
            }
        }
Beispiel #2
0
        private void ChangeAccessFor(ComponentManagerType _type)
        {
            if (this.ComponentToDisplay == null)
            {
                return;
            }

            foreach (var child in this.Children)
            {
                StackPanel sp = child as StackPanel;
                if (sp == null)
                {
                    continue;
                }
                if (sp.Tag == null)
                {
                    continue;
                }
                if (!(sp.Tag is ComponentManagerType))
                {
                    continue;
                }

                ComponentManagerType sp_type = (ComponentManagerType)sp.Tag;
                if (sp_type != _type)
                {
                    continue;
                }

                string access       = ComponentUtils.COMP_ACCESS_NONE;
                char[] access_chars = access.ToCharArray();

                foreach (var sp_child in sp.Children)
                {
                    TextBlockDoubleText sp_tb = sp_child as TextBlockDoubleText;
                    if (sp_tb == null)
                    {
                        continue;
                    }
                    if (sp_tb.Tag == null)
                    {
                        continue;
                    }
                    if (!(sp_tb.Tag is ComponentManagerAndAccessFlagDateTimeTriple))
                    {
                        continue;
                    }

                    ComponentManagerAndAccessFlagDateTimeTriple MAtp = (ComponentManagerAndAccessFlagDateTimeTriple)sp_tb.Tag;
                    access_chars[MAtp.AccessFlagIndex] = sp_tb.Text.ToCharArray()[0];
                }
                access = new string(access_chars);
                ComponentAccessType access_type = ComponentUtils.StringToComponentAccessType(access);

                ComponentAccessTracker tracker = this.ComponentToDisplay.AccessLocal[sp_type];
                tracker.AccessTypeFlags = access_type;
                this.ComponentToDisplay.AccessLocal[sp_type] = tracker;

                break;
            }
        }