public void EditTaskState(int stateID)
        {
            State state = (State)TaskManager.GetTaskState(stateID);

            if (state == null)
            {
                return;
            }
            ViewSingleStateDialog stateView = GuiFactory.CreateSingleStateView(MainForm, state);

            if (Gtk.ResponseType.Ok == (Gtk.ResponseType)stateView.ShowDialog())
            {
                state.Name = stateView.Name;

                state.ColorRed   = stateView.ColorRed;
                state.ColorGreen = stateView.ColorGreen;
                state.ColorBlue  = stateView.ColorBlue;

                state.Save();
                ControledGui.Source = TaskManager.TaskStateSource;
                ControledGui.BindStates();
                if (autosave)
                {
                    StorageManager.Save();
                }
            }
        }
        public void CreateTaskStateConnection(int stateID)
        {
            State state = (State)TaskManager.GetTaskState(stateID);

            if (state == null)
            {
                return;
            }
            ViewConnectionDialog connectionView = GuiFactory.CreateConnectionView(MainForm, TaskManager.TaskStateSource);

            if (Gtk.ResponseType.Ok == (Gtk.ResponseType)connectionView.ShowDialog())
            {
                State connectedState = (State)TaskManager.GetTaskState(connectionView.StateID);
                if (connectedState == null)
                {
                    return;
                }
                Connection connection = (Connection)TaskManager.CreateTaskStateConnection(state, connectedState);
                connection.Name = connectionView.Name;
                connection.Save();
                ControledGui.BindConnections(state);
                if (autosave)
                {
                    StorageManager.Save();
                }
            }
        }
Example #3
0
        private new void LoadXml(XElement InputXml)
        {
            base.LoadXml(InputXml);

            IEnumerable <XElement> xlist;
            IGuiOption             newOption;
            int index = 0;

            this.Width = XmlHandler.GetDoubleFromXElement(InputXml, "Width", double.NaN);
            //now read in the options and add to a dictionary for later use
            //do this last so the event subscriptions don't get setup too early (no toggles fired
            //until everything is loaded.
            xlist = InputXml.Elements("GuiOption");
            if (xlist != null)
            {
                foreach (XElement xOption in xlist)
                {
                    newOption = GuiFactory.CreateGuiOption(xOption, this);
                    if (newOption == null)
                    {
                        continue;
                    }
                    this._options.Add(newOption);

                    RowDefinition rowdef = new RowDefinition();
                    rowdef.Height = GridLength.Auto;
                    this._columnpanel.RowDefinitions.Add(rowdef);
                    Grid.SetRow(newOption.UserControl, index);

                    this._columnpanel.Children.Add(newOption.UserControl);

                    index++;
                }
            }
        }
        public void AssignTask(int taskID)
        {
            ViewTaskAssign assignView = null;

            try
            {
                assignView = GuiFactory.CreateTaskAssign(window, (IGuiCore)this, taskID);
            }
            catch (ManagementException ex)
            {
                IGuiMessageDialog dialog = MessageFactory.CreateErrorDialog(ex, window);
                dialog.Title = "Task Assign";
                dialog.ShowDialog();
                return;
            }

            if (assignView.ShowDialog() == (int)Gtk.ResponseType.Ok)
            {
                Task task = (Task)TaskManager.GetTask(taskID);
                if (task == null)
                {
                    return;
                }
                task.ActorID = assignView.ActorID;
                task.Save();
                Tracker.TaskSource = TaskManager.TaskSource;
                Tracker.BindTask();
                if (autosave)
                {
                    SaveProject();
                }
            }
        }
        public void CreateTaskState()
        {
            ViewSingleStateDialog stateView = GuiFactory.CreateSingleStateView(MainForm);

            if (Gtk.ResponseType.Ok == (Gtk.ResponseType)stateView.ShowDialog())
            {
                State newState = (State)StateFactory.CreateTaskState();
                if (newState == null)
                {
                    return;
                }
                newState.Name = stateView.Name;

                newState.ColorRed   = stateView.ColorRed;
                newState.ColorGreen = stateView.ColorGreen;
                newState.ColorBlue  = stateView.ColorBlue;

                newState.Save();
                ControledGui.Source = TaskManager.TaskStateSource;
                ControledGui.BindStates();
                if (autosave)
                {
                    StorageManager.Save();
                }
            }
        }
Example #6
0
 public void Sync(EnginePtr exeeng, Direct3D exed3d, OpenGL exeogl, Havok exehvk, GuiFactory exegui, Forms exefms, DirectIpt exedip, WinIpt exewip, FFmpeg exeffm, CryptoPP execpp, ID3Lib exeid3, WinAudio exewad, XAudio2 exexa2, WinMidi exemid, WinSock exewsk, AsyncWorkers exeaws, SQLite exesql, HaruPdf exepdf, RayTracer exertr, Pbrt exepbrt, PythonScriptEngine exepse, Console execle)
 {
     IronSightEnginePINVOKE.Pbrt_Sync(swigCPtr, EnginePtr.getCPtr(exeeng), Direct3D.getCPtr(exed3d), OpenGL.getCPtr(exeogl), Havok.getCPtr(exehvk), GuiFactory.getCPtr(exegui), Forms.getCPtr(exefms), DirectIpt.getCPtr(exedip), WinIpt.getCPtr(exewip), FFmpeg.getCPtr(exeffm), CryptoPP.getCPtr(execpp), ID3Lib.getCPtr(exeid3), WinAudio.getCPtr(exewad), XAudio2.getCPtr(exexa2), WinMidi.getCPtr(exemid), WinSock.getCPtr(exewsk), AsyncWorkers.getCPtr(exeaws), SQLite.getCPtr(exesql), HaruPdf.getCPtr(exepdf), RayTracer.getCPtr(exertr), Pbrt.getCPtr(exepbrt), PythonScriptEngine.getCPtr(exepse), Console.getCPtr(execle));
     if (IronSightEnginePINVOKE.SWIGPendingException.Pending)
     {
         throw IronSightEnginePINVOKE.SWIGPendingException.Retrieve();
     }
 }
        public void StateEdit()
        {
            ViewStateDialog stateView = null;

            stateView = GuiFactory.CreateStateView(window, (IGuiCore)this);

            if (Gtk.ResponseType.Ok == (Gtk.ResponseType)stateView.ShowDialog())
            {
                StorageManager.Save();
            }
        }
        public void CreateTask()
        {
            IGuiTask taskView = null;

            try
            {
                taskView = GuiFactory.CreateTaskView(window, (IGuiCore)this);
                if (taskView == null)
                {
                    return;
                }
            }
            catch (ManagementException ex)
            {
                IGuiMessageDialog dialog = MessageFactory.CreateErrorDialog(ex, window);
                dialog.Title = "Create Task";
                dialog.ShowDialog();
                return;
            }

            Tracker.ActorSource = TaskManager.ActorSource;
            Tracker.BindTask();
            if (taskView.ShowDialog() == (int)Gtk.ResponseType.Ok)
            {
                Task newTask = (Task)TaskManager.CreateTask();
                if (newTask == null)
                {
                    return;
                }
                if (taskView.ActorPresent)
                {
                    newTask.ActorID = taskView.ActorID;
                }
                else
                {
                    newTask.ActorPresent = false;
                }
                newTask.Description = taskView.Description;
                newTask.EndTime     = taskView.EndTime;
                newTask.StartTime   = taskView.StartTime;
                newTask.StateID     = taskView.StateID;
                newTask.Priority    = taskView.Priority;

                newTask.Save();

                Tracker.TaskSource = TaskManager.TaskSource;
                Tracker.BindTask();
                if (autosave)
                {
                    SaveProject();
                }
            }
        }
Example #9
0
        //****************************************

        public override EventHandler Connect(object target)
        {               //****************************************
            MethodInfo MyMethod;

            //****************************************

            MyMethod = GuiFactory.FindMethod(target.GetType(), ClickHandler);

            if (MyMethod == null)
            {
                return(null);
            }

            //****************************************

            return((EventHandler)Delegate.CreateDelegate(typeof(EventHandler), target, MyMethod));
        }
        /// <summary>
        /// Creates a unique instance of the plugin type, with new
        /// instances of all native-code instances needed to access
        /// the entire hardware API.
        /// </summary>
        public ImplantJSInstance CreateInstance(JavascriptImplant parent)
        {
            var implant = ImplantFactory.Construct(parent);

            implant.osc      = OscFactory.Construct(parent);
            implant.pads     = PadFactory.Construct(parent);
            implant.knobs    = KnobFactory.Construct(parent);
            implant.keys     = KeysFactory.Construct(parent);
            implant.gui      = GuiFactory.Construct(parent);
            implant.time     = TimeFactory.Construct(parent);
            implant.settings = SettingsFactory.Construct(parent);
            implant.shared   = StaticFactory.Construct(parent);
            implant.session  = SessionFactory.Construct(parent);
            implant.mode     = ModesFactory.Construct(parent);

            return(implant);
        }
Example #11
0
        public MenuChest(Entity entity, Entity chest, GameState gameState) : base(gameState)
        {
            PauseGame     = true;
            EscapeToClose = true;

            _inventoryA = new WidgetItemContainer(entity.GetComponent <ComponentInventory>().Content)
            {
                Padding = new Spacing(4, 4), Dock = Dock.Fill
            };
            _inventoryB = new WidgetItemContainer(chest.GetComponent <ComponentInventory>().Content)
            {
                Padding = new Spacing(4, 4), Dock = Dock.Fill
            };

            _inventoryA.MouseClick += Tranfer;
            _inventoryB.MouseClick += Tranfer;

            var closeBtn = new WidgetSprite()
            {
                Sprite    = new Sprite(Resources.TileGui, new Point(7, 7)),
                UnitBound = new Rectangle(0, 0, 48, 48),
                Anchor    = Anchor.TopLeft,
                Origine   = Anchor.Center
            };

            closeBtn.MouseClick += CloseBtnOnMouseClick;

            Content = new WidgetFancyPanel()
            {
                Content = new LayoutDock()
                {
                    Children =
                    {
                        new LayoutDock()
                        {
                            Dock     = Dock.Fill,
                            Children ={ closeBtn                }
                        },
                        GuiFactory.CreateSplitContainer(new Rectangle(0, 0, 64, 64), "Inventory", _inventoryA, "Chest",
                                                        _inventoryB),
                    }
                }
            };
        }
Example #12
0
        VisitStatus IVisitContainerAdapter.BeginContainer <TProperty, TValue, TContainer>(
            IPropertyVisitor visitor,
            TProperty property,
            ref TContainer container,
            ref TValue value,
            ref ChangeTracker changeTracker)
        {
            if (!typeof(UnityEngine.Object).IsAssignableFrom(typeof(TValue)))
            {
                return(VisitStatus.Unhandled);
            }

            var obj   = value as UnityEngine.Object;
            var field = GuiFactory.Construct <TProperty, TContainer, TValue>(property, ref container,
                                                                             obj, VisitorContext);

            field.objectType = typeof(TValue);

            return(VisitStatus.Override);
        }
        public void UpdateTaskState(int taskID)
        {
            IGuiTask taskView = null;

            try
            {
                taskView = GuiFactory.CreateTaskView(window, (IGuiCore)this, taskID);
            }
            catch (ManagementException ex)
            {
                IGuiMessageDialog dialog = MessageFactory.CreateErrorDialog(ex, window);
                dialog.Title = "Change Task State";
                dialog.ShowDialog();
                return;
            }

            if (taskView.ShowDialog() == (int)Gtk.ResponseType.Ok)
            {
                Task task = (Task)TaskManager.GetTask(taskID);
                if (task == null)
                {
                    return;
                }
                if (taskView.ActorPresent)
                {
                    task.ActorID = taskView.ActorID;
                }
                task.Description = taskView.Description;
                task.EndTime     = taskView.EndTime;
                task.StartTime   = taskView.StartTime;
                task.StateID     = taskView.StateID;
                task.Priority    = taskView.Priority;
                task.Save();
                Tracker.TaskSource = TaskManager.TaskSource;
                Tracker.BindTask();
                if (autosave)
                {
                    SaveProject();
                }
            }
        }
        public void CreateActor()
        {
            IGuiActorView actorView = GuiFactory.CreateActorView(window);

            if (actorView.ShowDialog() == (int)Gtk.ResponseType.Ok)
            {
                Actor newActor = (Actor)TaskManager.CreateActor();
                if (newActor == null)
                {
                    return;
                }
                newActor.Name  = actorView.ActorName;
                newActor.Email = actorView.ActorEmail;
                newActor.Save();
                Tracker.ActorSource = TaskManager.ActorSource;
                Tracker.BindActor();
                if (autosave)
                {
                    SaveProject();
                }
            }
        }
Example #15
0
        VisitStatus IVisitAdapter.Visit <TProperty, TContainer, TValue>(
            IPropertyVisitor visitor,
            TProperty property,
            ref TContainer container,
            ref TValue value,
            ref ChangeTracker changeTracker)
        {
            if (!typeof(TValue).IsEnum)
            {
                return(VisitStatus.Unhandled);
            }

            if (RuntimeTypeInfoCache <TValue> .IsFlagsEnum())
            {
                GuiFactory.FlagsField(property, ref container, ref value, VisitorContext);
            }
            else
            {
                GuiFactory.EnumField(property, ref container, ref value, VisitorContext);
            }
            return(VisitStatus.Override);
        }
Example #16
0
        public new void LoadXml(XElement SourceXml)
        {
            base.LoadXml(SourceXml);
            XElement subx;
            XElement x;

            if (SourceXml != null)
            {
                x = SourceXml.Element("Footer");
                if (x != null)
                {
                    subx = x.Element("Text");
                    if (subx != null)
                    {
                        this.FooterText = subx.Value;
                    }

                    subx = x.Element("Height");
                    if (subx != null)
                    {
                        this.FooterHeight = Convert.ToInt32(subx.Value);
                    }

                    GuiFactory.LoadHAlignment(x, ref this._footerHAlignment);
                }

                this.TopMost     = XmlHandler.GetBoolFromXElement(SourceXml, "TopMost", this.TopMost);
                this.WindowTitle = XmlHandler.GetStringFromXElement(SourceXml, "Title", this.WindowTitle);

                x = SourceXml.Element("WindowLocation");
                if (x != null)
                {
                    this.WindowLocation.LoadXml(x);
                }

                GuiFactory.LoadMargins(SourceXml, this._pageMargin);
            }
        }
        public void EditActor(int actorID)
        {
            Actor actor = (Actor)TaskManager.GetActor(actorID);

            if (actor == null)
            {
                return;
            }
            IGuiActorView actorView = GuiFactory.CreateActorView(window, TaskManager, actor);

            if (actorView.ShowDialog() == (int)Gtk.ResponseType.Ok)
            {
                actor.Name  = actorView.ActorName;
                actor.Email = actorView.ActorEmail;
                actor.Save();
                Tracker.ActorSource = TaskManager.ActorSource;
                Tracker.BindActor();
                if (autosave)
                {
                    SaveProject();
                }
            }
        }
Example #18
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GuiFactory obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
        public void ShowAboutDialog()
        {
            AboutDialog aboutView = (AboutDialog)GuiFactory.CreateAboutDialog(window);

            aboutView.ShowDialog();
        }
Example #20
0
        public void ChangeState(int state)
        {
            //Title screen state
            if (state == GameCore.STATE_TITLE)
            {
                UnloadGame();
                GameState = GameCore.STATE_TITLE;
                if (highScoresGui != null)
                {
                    highScoresGui.Dispose();
                }
                titleGui = GuiFactory.CreateTitleGui(this, titleGui, inputManager);
            }
            //Play the game state
            else if (state == GameCore.STATE_GAME)
            {
                LoadGame();
                GameState = GameCore.STATE_GAME;
                titleGui.Dispose();
            }
            //Show the high scores state
            else if (state == GameCore.STATE_SCORES)
            {
                UnloadGame();
                GameState = GameCore.STATE_SCORES;
                titleGui.Dispose();
                if (inputHighScoreGui != null)
                {
                    inputHighScoreGui.Dispose();
                }
                highScoresGui = GuiFactory.CreateHighScoresGui(this, highScoresGui, inputManager);
                SortHighScores();
            }
            //Game over state
            else if (state == GameCore.STATE_GAMEOVER)
            {
                score = World.Score;
                UnloadGame();
                var addTo = false;
                foreach (HighScore scoreData in HighScoreData)
                {
                    if (score > scoreData.Score)
                    {
                        addTo = true;
                        break;
                    }
                }
                if (HighScoreData.Count < 10)
                {
                    addTo = true;
                }
                if (addTo)
                {
                    ChangeState(GameCore.STATE_INPUTSCORE);
                }
                else
                {
                    ChangeState(GameCore.STATE_SCORES);
                }
            }

            else if (state == GameCore.STATE_INPUTSCORE)
            {
                GameState         = GameCore.STATE_INPUTSCORE;
                inputHighScoreGui = GuiFactory.CreateInputHighScoreGui(this, inputHighScoreGui, inputManager);
            }
        }