/// <summary>转换函数
        ///
        /// </summary>
        /// <param name="Grid"></param>
        /// <param name="node"></param>
        /// <param name="viewName"></param>
        /// <param name="removeOld"></param>
        protected virtual void ChangeView(GridControl Grid, GridLevelNode node, string viewName, bool removeOld)
        {
            GridLevelNode levelNode = node;

            if (levelNode == null)
            {
                return;
            }
            BaseView view = Grid.CreateView(viewName);

            Grid.ViewCollection.Add(view);
            BaseView     prev = levelNode.LevelTemplate;
            MemoryStream ms   = null;

            if (prev != null)
            {
                ms = new MemoryStream();
                prev.SaveLayoutToStream(ms, OptionsLayoutBase.FullLayout);
            }

            if (node.IsRootLevel)
            {
                prev          = Grid.MainView;
                Grid.MainView = view;
            }
            else
            {
                levelNode.LevelTemplate = view;
            }
            if (ms != null)
            {
                if (removeOld && prev != null)
                {
                    prev.Dispose();
                }
                ms.Seek(0, SeekOrigin.Begin);
                view.RestoreLayoutFromStream(ms, OptionsLayoutBase.FullLayout);
                ms.Close();
                MethodInfo mi = view.GetType().GetMethod("DesignerMakeColumnsVisible", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance);
                if (mi != null)
                {
                    mi.Invoke(view, null);
                }
                if (prev != null)
                {
                    AssignViewProperties(prev, view);
                }
            }
            if (removeOld && prev != null)
            {
                prev.Dispose();
            }
        }
Exemple #2
0
        void ReleaseDesignerOutlets()
        {
            if (BaseView != null)
            {
                BaseView.Dispose();
                BaseView = null;
            }

            if (CancelBarButton != null)
            {
                CancelBarButton.Dispose();
                CancelBarButton = null;
            }

            if (OptionsContainer != null)
            {
                OptionsContainer.Dispose();
                OptionsContainer = null;
            }

            if (PasswordLabel != null)
            {
                PasswordLabel.Dispose();
                PasswordLabel = null;
            }

            if (SelectBarButton != null)
            {
                SelectBarButton.Dispose();
                SelectBarButton = null;
            }
        }
Exemple #3
0
 public void Dispose()
 {
     if (_faceModel != null)
     {
         _faceModel.Dispose();
     }
 }
Exemple #4
0
 public virtual void Dispose()
 {
     if (mBaseView != null)
     {
         mBaseView.Dispose();
     }
     if (mBaseModel != null)
     {
         mBaseModel.Dispose();
     }
 }
Exemple #5
0
        public void Dispose()
        {
            loader?.Dispose();
            loader = null;

            mainView?.Dispose();
            mainView = null;

            mediaSource?.Dispose();
            mediaSource = null;
        }
 void ReleaseDesignerOutlets()
 {
     if (BaseView != null)
     {
         BaseView.Dispose();
         BaseView = null;
     }
     if (PhotoPreview != null)
     {
         PhotoPreview.Dispose();
         PhotoPreview = null;
     }
     if (ResizePhotoButton != null)
     {
         ResizePhotoButton.Dispose();
         ResizePhotoButton = null;
     }
     if (SelectPhotoButton != null)
     {
         SelectPhotoButton.Dispose();
         SelectPhotoButton = null;
     }
 }
        /// <summary>
        /// Top画面へ遷移
        /// </summary>
        public void ChangeTopView()
        {
            // 現在画面の終了
            if (NowView != null)
            {
                NowView.Dispose();
                NowView = null;
            }

            // 画面表示をTOPに変更
            NowView = new TopView();

            // イベントを設定
            EventRegistration();

            // 新規の画面なのでCreateViewを呼ぶ
            NowView.CreateView();

            // TOP画面へ更新
            EventScreenView(this, EventArgs.Empty);

            // スタッククリア(各画面開放)
            ViewStack.Clear();
        }
Exemple #8
0
        /// <summary>
        /// Einen View eines GridControls ändern
        /// </summary>
        /// <param name="grid">Das Grid, für den der View geändert werden soll</param>
        /// <param name="node">Der Node innerhalb der View-Hiearchie, für den der View geändert werden soll.</param>
        /// <param name="viewName">Name (Typ) des neuen Views.</param>
        /// <param name="removeOld"></param>
        /// <returns>Der erstellte View</returns>
        public static BaseView CreateView(GridControl grid, GridLevelNode node, string viewName, bool removeOld)
        {
            if (node == null)
            {
                return(null);
            }

            // View schoh da.
            BaseView previousView = node.LevelTemplate;

            if (previousView is GridView)
            {
                var gv = previousView as GridView;
                gv.GroupCount = 0;
                // gv.FilteredColumnsCount = 0;
            }


            // Neuen View erzeugen
            BaseView newView = grid.CreateView(viewName);

            Debug.Assert(newView != null, "View " + viewName + " konnte nicht angelegt werden.");
            grid.ViewCollection.Add(newView);

            // Layout des alten Views sichern.
            previousView = node.LevelTemplate;
            MemoryStream ms = null;

            if (previousView != null)
            {
                ms = new MemoryStream();
                previousView.SaveLayoutToStream(ms, OptionsLayoutBase.FullLayout);
            }

            // Dem Node den neuen View zuweisen.
            ChangeView(grid, node, newView);

            if (ms != null)
            {
                ms.Seek(0, SeekOrigin.Begin);
                newView.RestoreLayoutFromStream(ms, OptionsLayoutBase.FullLayout);
                ms.Close();

                MethodInfo mi = newView.GetType()
                                .GetMethod("DesignerMakeColumnsVisible",
                                           BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance);
                if (mi != null)
                {
                    mi.Invoke(newView, null);
                }
                if (previousView != null)
                {
                    AssignViewProperties(previousView, newView);
                }
            }
            if (removeOld && previousView != null)
            {
                previousView.Dispose();
            }
            return(newView);
        }
        void ReleaseDesignerOutlets()
        {
            if (AddSkillButton != null)
            {
                AddSkillButton.Dispose();
                AddSkillButton = null;
            }

            if (AuraButton != null)
            {
                AuraButton.Dispose();
                AuraButton = null;
            }

            if (AvailableSkillsTable != null)
            {
                AvailableSkillsTable.Dispose();
                AvailableSkillsTable = null;
            }

            if (BaseAtkButton != null)
            {
                BaseAtkButton.Dispose();
                BaseAtkButton = null;
            }

            if (BaseView != null)
            {
                BaseView.Dispose();
                BaseView = null;
            }

            if (CMBButton != null)
            {
                CMBButton.Dispose();
                CMBButton = null;
            }

            if (CMDButton != null)
            {
                CMDButton.Dispose();
                CMDButton = null;
            }

            if (DescriptionView != null)
            {
                DescriptionView.Dispose();
                DescriptionView = null;
            }

            if (GearButton != null)
            {
                GearButton.Dispose();
                GearButton = null;
            }

            if (KnownSkillsTable != null)
            {
                KnownSkillsTable.Dispose();
                KnownSkillsTable = null;
            }

            if (LanguagesButton != null)
            {
                LanguagesButton.Dispose();
                LanguagesButton = null;
            }

            if (ModView != null)
            {
                ModView.Dispose();
                ModView = null;
            }

            if (RacialModsButton != null)
            {
                RacialModsButton.Dispose();
                RacialModsButton = null;
            }

            if (SkillDetailButton != null)
            {
                SkillDetailButton.Dispose();
                SkillDetailButton = null;
            }

            if (SkillDetailSelectButton != null)
            {
                SkillDetailSelectButton.Dispose();
                SkillDetailSelectButton = null;
            }

            if (SkillsView != null)
            {
                SkillsView.Dispose();
                SkillsView = null;
            }

            if (SQButton != null)
            {
                SQButton.Dispose();
                SQButton = null;
            }
        }
        private void toolCard_Click(object sender, EventArgs e)
        {
            Cursor currentCursor = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;

            IEnumerator enumGridControl = _componentContainer.GetEnumerator();

            while (enumGridControl.MoveNext())
            {
                GridControl grd = enumGridControl.Current as GridControl;

                if (grd != null)
                {
                    BaseView oldView = grd.MainView;

                    DevExpress.XtraGrid.StyleFormatCondition[] styles = new DevExpress.XtraGrid.StyleFormatCondition[grd.MainView.FormatConditions.Count];

                    for (int i = 0; i < styles.Length; i++)
                    {
                        styles[i] = grd.MainView.FormatConditions[i];
                    }

                    grd.MainView = grd.CreateView(toolCard.Text == "卡片" ? "CardView" : "GridView");

                    if (grd.MainView is GridView)
                    {
                        GridView gv = grd.MainView as GridView;
                        gv.OptionsView.ColumnAutoWidth      = false;
                        gv.OptionsView.ShowGroupPanel       = false;
                        gv.OptionsCustomization.AllowFilter = false;
                        gv.OptionsBehavior.Editable         = false;
                        gv.OptionsView.ShowDetailButtons    = false;
                        gv.OptionsView.ShowFooter           = true;
                        gv.FocusRectStyle = DrawFocusRectStyle.RowFocus;
                        gv.OptionsSelection.EnableAppearanceFocusedCell = false;
                        gv.PaintStyleName       = "WindowsXP";
                        gv.RowHeight            = 25;
                        gv.ColumnPanelRowHeight = 30;
                    }
                    else if (grd.MainView is CardView)
                    {
                        CardView gv = grd.MainView as CardView;
                        gv.OptionsBehavior.Editable = false;
                        gv.PaintStyleName           = "WindowsXP";
                    }

                    grd.MainView.FormatConditions.AddRange(styles);

                    if (toolCard.Text == "卡片")
                    {
                        toolCard.Text = "表格";
                    }
                    else
                    {
                        toolCard.Text = "卡片";
                    }

                    if (oldView != null)
                    {
                        oldView.Dispose();
                    }

                    Cursor.Current = currentCursor;
                }
            }
        }