public NodeSelectForm(INode rootNode, Func <T, bool> filter = null)
        {
            InitializeComponent();

            if (StyleSet.CurrentStyle != null)
            {
                StyleHelpers.ApplyStyle(this, StyleSet.CurrentStyle);
            }

            Icon = ResourceStore.LoadIcon("Icons/Application.ico");

            mRootNode = new ReferenceNode(rootNode);
            mRootNode.Populate();

            foreach (var node in mRootNode.Nodes)
            {
                if (node.DataType != typeof(T))
                {
                    continue;
                }

                if (filter != null && !filter(( T )node.Data))
                {
                    continue;
                }

                mNodeTreeView.Nodes.Add(new NodeAsTreeNode(new ReferenceNode(node), true)
                {
                    HideContextMenuStrip = true
                });
            }

            StyleHelpers.ApplySystemFont(this);
        }
Example #2
0
        public TextureSelectForm(INode textureSetNode)
        {
            InitializeComponent();

            if (StyleSet.CurrentStyle != null)
            {
                StyleHelpers.ApplyStyle(this, StyleSet.CurrentStyle);
            }

            Icon = ResourceStore.LoadIcon("Icons/Application.ico");

            var rootNode = new ReferenceNode(textureSetNode);

            var nodeAsTreeNode = new NodeAsTreeNode(rootNode);

            mNodeTreeView.Nodes.Add(nodeAsTreeNode);

            nodeAsTreeNode.Expand();
            nodeAsTreeNode.Nodes[0].Expand();
        }
        protected override void OnLoad(EventArgs eventArgs)
        {
            if (Type.GetType("Mono.Runtime") == null)
            {
                StyleHelpers.StoreDefaultStyle(this);

                if (StyleSet.CurrentStyle != null)
                {
                    StyleHelpers.ApplyStyle(this, StyleSet.CurrentStyle);
                }

                StyleSet.StyleChanged += OnStyleChanged;

                InitializeStylesToolStripMenuItem();
            }

            if (!ValueCache.Get <bool>("IsNotFirstLaunch"))
            {
                using (var firstLaunchForm = new FirstLaunchForm())
                    firstLaunchForm.ShowDialog(this);

                ValueCache.Set("IsNotFirstLaunch", true);
            }

            ModelViewControl.UseOrbitCamera = ValueCache.Get("UseOrbitCamera", true);
            UpdateCameraModeFlags();

            mAutoCheckUpdatesToolStripMenuItem.Checked = ValueCache.Get("AutoCheckUpdates", true);

            if (mAutoCheckUpdatesToolStripMenuItem.Checked)
            {
                new Thread(() => CheckForUpdates(false)).Start();
            }

            SetStyle(ControlStyles.DoubleBuffer, true);

            base.OnLoad(eventArgs);
        }
Example #4
0
        public FarcArchiveViewForm(FarcArchive farcArchive)
        {
            InitializeComponent();

            if (StyleSet.CurrentStyle != null)
            {
                StyleHelpers.ApplyStyle(this, StyleSet.CurrentStyle);
            }

            Icon = ResourceStore.LoadIcon("Icons/Application.ico");

            mFarcArchive = farcArchive;
            mRootNode    = new FarcArchiveNode("FARC Archive", mFarcArchive);
            mRootNode.Populate();

            foreach (var node in mRootNode.Nodes.Where(x => x.DataType == typeof(T)))
            {
                mNodeTreeView.Nodes.Add(new NodeAsTreeNode(new ReferenceNode(node), true)
                {
                    HideContextMenuStrip = true
                });
            }
        }
Example #5
0
        private void OnStyleChanged(object sender, StyleChangedEventArgs eventArgs)
        {
            StyleHelpers.ApplyStyle(this, eventArgs.Style);

            Refresh();
        }