Esempio n. 1
0
        private void setVisibleFrame(WindowFrames frame)
        {
            organizationsFrame.Visibility = Visibility.Collapsed;
            organizationFrame.Visibility  = Visibility.Collapsed;
            mainWindow.Visibility         = Visibility.Collapsed;
            switch (frame)
            {
            case WindowFrames.Main:
                mainWindow.Visibility = Visibility.Visible;
                break;

            case WindowFrames.Organization:
                organizationFrame.Visibility = Visibility.Visible;
                break;

            case WindowFrames.Organizations:
                organizationsFrame.Visibility = Visibility.Visible;
                break;
            }
        }
Esempio n. 2
0
        public void SetFrames(BxlytHeader header)
        {
            if (WindowFrames == null)
            {
                WindowFrames = new List <BxlytWindowFrame>();
            }

            switch (FrameCount)
            {
            case 1:
                if (WindowFrames.Count == 0)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_LT"));
                }
                break;

            case 2:
                if (WindowFrames.Count == 0)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_L"));
                }
                if (WindowFrames.Count == 1)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_R"));
                }
                break;

            case 4:
                if (WindowFrames.Count == 0)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_LT"));
                }
                if (WindowFrames.Count == 1)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_RT"));
                }
                if (WindowFrames.Count == 2)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_LB"));
                }
                if (WindowFrames.Count == 3)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_RB"));
                }
                break;

            case 8:
                if (WindowFrames.Count == 0)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_LT"));
                }
                if (WindowFrames.Count == 1)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_RT"));
                }
                if (WindowFrames.Count == 2)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_LB"));
                }
                if (WindowFrames.Count == 3)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_RB"));
                }
                if (WindowFrames.Count == 4)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_T"));
                }
                if (WindowFrames.Count == 5)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_B"));
                }
                if (WindowFrames.Count == 6)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_R"));
                }
                if (WindowFrames.Count == 7)
                {
                    WindowFrames.Add(new BxlytWindowFrame(header, $"{Name}_L"));
                }
                break;
            }

            //Now search for invalid unused materials and remove them
            for (int i = 0; i < WindowFrames.Count; i++)
            {
                if (i >= FrameCount)
                {
                    header.TryRemoveMaterial(WindowFrames[i].Material);
                }
                else if (!header.Materials.Contains(WindowFrames[i].Material))
                {
                    header.AddMaterial(WindowFrames[i].Material);
                }
            }
        }