public MasterController(GraphicsDeviceManager a_manager, ContentManager a_contentManager, GraphicsDevice a_graphics)
 {
     m_view = new View.View(a_manager, a_contentManager, a_graphics);
     m_menu = new View.Menu(a_manager, a_contentManager, m_view);
     m_gameController = new GameController(m_view, m_camera, m_menu, m_manager, a_contentManager);
     m_manager = a_manager;
 }
Exemple #2
0
 public Board()
 {
     _gameFinished = false;
     _pause        = false;
     _snake        = new Snake(PointFactory.Create(10, 10));
     _view         = new View.View();
 }
Exemple #3
0
        public bool OnItemLongClick(AdapterView <object> adapterView, View.View view, int position, long id)
        {
            var args = new ItemClickEventArgs(view, position, id);

            Invoke(adapterView, args);
            return(args.IsHandled);
        }
Exemple #4
0
        public bool OnGroupClick(ExpandableListView parent, View.View v, int groupPosition, long id)
        {
            var args = new GroupClickEventArgs(v, groupPosition, id);

            GroupClick.Invoke(parent, args);
            return(args.IsHandled);
        }
Exemple #5
0
 public ChildClickEventArgs(View.View view, int groupPosition, int childPosition, long id)
 {
     Id            = id;
     ChildPosition = childPosition;
     GroupPosition = groupPosition;
     View          = view;
 }
Exemple #6
0
        public void OpenResource(Panel parentPanel, PhactoryHost.Database.Resource resource)
        {
            View.View view = new View.View(resource);
            view.Parent = parentPanel;
            view.Dock   = System.Windows.Forms.DockStyle.Fill;

            ResourceBinding resourceBinding = new ResourceBinding(parentPanel, view);

            viewBinding.Add(resource, resourceBinding);

            resourceBinding.View.Document = Host.XMLRead <Document.Document>(Host.GetFileInfo(resource).FullName);

            if (resourceBinding.View.Document is Document.Document)
            {
                if (Host.IsVerboseOutput())
                {
                    Host.Log(resource.DisplayName + " loaded");
                }
            }
            else
            {
                Host.Log("Problem while loading " + resource.DisplayName);
            }

            view.RefreshUI();
            view.RefreshTitle();

            view.IsReady = true;
        }
Exemple #7
0
        public void OpenResource(Panel parentPanel, PhactoryHost.Database.Resource resource)
        {
            View.View view = new View.View(resource);
            view.Parent = parentPanel;
            view.Dock   = System.Windows.Forms.DockStyle.Fill;

            viewBinding.Add(resource, new ResourceBinding(parentPanel, view));

            try
            {
                view.PictureBox.Image   = Image.FromFile(Host.GetFileInfo(resource).FullName, true);
                view.PictureWidth.Text  = "" + view.PictureBox.Image.Width + " Pixel(s)";
                view.PictureHeight.Text = "" + view.PictureBox.Image.Height + " Pixel(s)";
                view.PictureDepth.Text  = "" + view.PictureBox.Image.PixelFormat.ToString();

                if (Host.IsVerboseOutput())
                {
                    Host.Log(resource.DisplayName + " loaded");
                }
            }
            catch (System.IO.FileNotFoundException)
            {
                Host.Log("Problem while loading " + resource.DisplayName);
            }

            view.RefreshTitle();

            view.IsReady = true;
        }
Exemple #8
0
 public void SetLine(PhactoryHost.Database.Resource resource, int line)
 {
     if (viewBinding.ContainsKey(resource))
     {
         View.View view = viewBinding[resource].View;
         view.SetLine(line);
     }
 }
        public MasterController(GraphicsDeviceManager a_manager, ContentManager a_contentManager)
        {
            m_model = new Model.Model();

            m_view = new View.View(a_manager, a_contentManager);
            m_menu = new View.Menu(a_manager, a_contentManager);
            m_pause = new View.Menu(a_manager, a_contentManager);
            m_death = new View.Menu(a_manager, a_contentManager);
        }
Exemple #10
0
        public void OpenResource(Panel parentPanel, PhactoryHost.Database.Resource resource)
        {
            View.View view = new View.View(resource);
            view.Parent = parentPanel;
            view.Dock   = System.Windows.Forms.DockStyle.Fill;

            viewBinding.Add(resource, new ResourceBinding(parentPanel, view));

            bool highLight = false;

            string language = "";

            switch (Host.GetFileInfo(resource).Extension.ToLower())
            {
            case ".s":
            case ".asm":
            case ".c":
            case ".h":
            case ".cxx":
            case ".cpp":
                highLight = true;
                break;

            default:
                highLight = false;
                break;
            }
            if (language.Length != 0)
            {
                //view.textEditorControl.ConfigurationManager.Language = language;
            }

            if (highLight)
            {
                HighlightingManager.Manager.AddSyntaxModeFileProvider(new FileSyntaxModeProvider(Application.StartupPath));
                view.textEditorControl.Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("c_z80");
            }

            FileInfo fileInfo    = Host.GetFileInfo(resource);
            string   fileContent = File.ReadAllText(fileInfo.FullName);;

            view.textEditorControl.Text = fileContent;

            if (Host.IsVerboseOutput())
            {
                Host.Log(resource.DisplayName + " loaded");
            }

            view.IsReady = true;

            if (resource.IsOutputResource)
            {
                view.SetReadOnly(true);
            }

            view.RefreshTitle();
        }
 public GameController(View.View a_view, View.Camera a_camera, View.Menu a_menu, GraphicsDeviceManager a_manager, ContentManager a_contentManager)
 {
     m_enemyBolt = new Model.EnemyBolt();
     m_view = a_view;
     m_menu = a_menu;
     m_camera = a_camera;
     m_manager = a_manager;
     m_model = new Model.Model(m_player, m_statehandler, m_levels, m_enemy, m_enemyBolt);
     //    m_sound = new Model.SoundManager(a_contentManager);
     m_save = new Model.Save(m_player, m_statehandler, m_levels, m_model);
 }
Exemple #12
0
        public void OnResourceChanged(PhactoryHost.Database.Resource resource)
        {
            View.View view = viewBinding[resource].View;

            FileInfo fileInfo    = Host.GetFileInfo(resource);
            string   fileContent = File.ReadAllText(fileInfo.FullName);

            view.RefreshContent();

            Host.Log(resource.DisplayName + " refreshed");
        }
 public Playmode(gameState s, KTYD.Model.Map g, Boolean p, KeyboardState i, bool[] ps, float st, float[] t, Controller.Players gPlayers, Dictionary<PlayerIndex, int> test, View.View gView)
     : base(s)
 {
     c = test;
     gamePlayers = gPlayers;
     gameMap = g;
     pauseGame = p;
     input = i;
     pressShoot = ps;
     storeTime = st;
     time = t;
     gameView = gView;
 }
Exemple #14
0
        public bool IsResourceModified(PhactoryHost.Database.Resource resource)
        {
            View.View view = null;

            try
            {
                view = viewBinding[resource].View;
            }
            catch (KeyNotFoundException)
            {
                return(false);
            }

            return(view.IsModified());
        }
Exemple #15
0
        public bool IsResourceOpened(PhactoryHost.Database.Resource resource)
        {
            try
            {
                View.View view = viewBinding[resource].View;
                if (view != null)
                {
                    return(true);
                }
            }
            catch
            {
            }

            return(false);
        }
Exemple #16
0
        public void OpenResource(Panel parentPanel, PhactoryHost.Database.Resource resource)
        {
            View.View view = new View.View(resource);
            view.Parent = parentPanel;
            view.Dock   = System.Windows.Forms.DockStyle.Fill;

            viewBinding.Add(resource, new ResourceBinding(parentPanel, view));

            view.RefreshContent();
            view.RefreshTitle();

            if (Host.IsVerboseOutput())
            {
                Host.Log(resource.DisplayName + " loaded");
            }

            view.IsReady = true;
        }
Exemple #17
0
 private static void Main(string[] args)
 {
     IView view = new View.View();
     var controler = new Controler(view);
     controler.Start();
     while (controler.Alive)
     {
         try
         {
             Thread.Sleep(10);
             Application.DoEvents();
         }
         catch
         {
             MessageBox.Show("DoEvents errror");
         }
     }
 }
Exemple #18
0
        private static void Main(string[] args)
        {
            IView view      = new View.View();
            var   controler = new Controler(view);

            controler.Start();
            while (controler.Alive)
            {
                try
                {
                    Thread.Sleep(10);
                    Application.DoEvents();
                }
                catch
                {
                    MessageBox.Show("DoEvents errror");
                }
            }
        }
Exemple #19
0
        protected IViewable View([CallerMemberName] string caller = "")
        {
            this.InitializeViewModelData();

            string controllerName = this.GetType()
                                    .Name
                                    .Replace(MvcContext.Get.ControllersSuffix, string.Empty);

            string fullQualifiedNAme = string.Format(
                "{0}.{1}.{2}.{3}, {0}",
                MvcContext.Get.AssemblyName,
                MvcContext.Get.ViewsFolder,
                controllerName,
                caller);

            IRenderable view = new View.View(fullQualifiedNAme, this.Model.Data);

            return(new ViewResult(view));
        }
Exemple #20
0
        public void SaveResource(PhactoryHost.Database.Resource resource)
        {
            if (viewBinding.ContainsKey(resource))
            {
                View.View view = viewBinding[resource].View;

                IgnoreNextResource = resource;

                FileInfo fileInfo = Host.GetFileInfo(resource);
                view.WriteContentToFile(fileInfo.FullName);

                if (Host.IsVerboseOutput())
                {
                    Host.Log(resource.DisplayName + " written");
                }

                Host.RefreshOutput(resource);

                view.SetModified(false);
            }
        }
Exemple #21
0
        static void Main(string[] args)
        {
            View.View view = new View.View();
            view.PrintApplicationInfo();
            view.PrintApplicationOptions();

            var applicationModeView = view.PrintSelectApplicationMode();

            if (applicationModeView == ApplicationModeView.Client)
            {
                view.PrintInformationAboutClientMode();
            }

            if (applicationModeView == ApplicationModeView.Server)
            {
                view.PrintInformationAboutServerMode();
            }

            IApplicationControllerFactory applicationControllerFactory = new ApplicationControllerFactory();
            IApplicationController        applicationController        = applicationControllerFactory.Create(applicationModeView);

            applicationController.Run();
        }
Exemple #22
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public ItemClickEventArgs(View.View view, int position, long id)
 {
     Id       = id;
     Position = position;
     View     = view;
 }
Exemple #23
0
 public MovedToScrapHeapEventArgs(View.View view)
 {
     View = view;
 }
Exemple #24
0
 public ClientController()
 {
     _view = new View.View();
 }
Exemple #25
0
        public void OpenResource(Panel parentPanel, PhactoryHost.Database.Resource resource)
        {
            View.View view = new View.View(resource);
            view.Parent = parentPanel;
            view.Dock = System.Windows.Forms.DockStyle.Fill;

            viewBinding.Add(resource, new ResourceBinding(parentPanel, view));

            bool highLight = false;

            string language = "";
            switch (Host.GetFileInfo(resource).Extension.ToLower())
            {
                case ".s":
                case ".asm":
                case ".c":
                case ".h":
                case ".cxx":
                case ".cpp":
                    highLight = true;
                    break;
                default:
                    highLight = false;
                    break;
            }
            if (language.Length != 0)
            {
                //view.textEditorControl.ConfigurationManager.Language = language;
            }

            if (highLight)
            {
                HighlightingManager.Manager.AddSyntaxModeFileProvider(new FileSyntaxModeProvider(Application.StartupPath));
                view.textEditorControl.Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("c_z80");
            }

            FileInfo fileInfo = Host.GetFileInfo(resource);
            string fileContent = File.ReadAllText(fileInfo.FullName); ;
            view.textEditorControl.Text = fileContent;

            if (Host.IsVerboseOutput())
            {
                Host.Log(resource.DisplayName + " loaded");
            }

            view.IsReady = true;

            if (resource.IsOutputResource)
            {
                view.SetReadOnly(true);
            }

            view.RefreshTitle();
        }
Exemple #26
0
        public bool IsResourceModified(PhactoryHost.Database.Resource resource)
        {
            View.View view = viewBinding[resource].View;

            return(view.IsModified());
        }
Exemple #27
0
 public GroupClickEventArgs(View.View view, int groupPosition, long id)
 {
     Id            = id;
     GroupPosition = groupPosition;
     View          = view;
 }
Exemple #28
0
        public void OpenResource(Panel parentPanel, PhactoryHost.Database.Resource resource)
        {
            View.View view = new View.View(resource);
            view.Parent = parentPanel;
            view.Dock = System.Windows.Forms.DockStyle.Fill;

            viewBinding.Add(resource, new ResourceBinding(parentPanel, view));

            try
            {
                view.PictureBox.Image = Image.FromFile(Host.GetFileInfo(resource).FullName, true);
                view.PictureWidth.Text = "" + view.PictureBox.Image.Width + " Pixel(s)";
                view.PictureHeight.Text = "" + view.PictureBox.Image.Height + " Pixel(s)";
                view.PictureDepth.Text = "" + view.PictureBox.Image.PixelFormat.ToString();

                if (Host.IsVerboseOutput())
                {
                    Host.Log(resource.DisplayName + " loaded");
                }
            }
            catch (System.IO.FileNotFoundException)
            {
                Host.Log("Problem while loading " + resource.DisplayName);
            }

            view.RefreshTitle();

            view.IsReady = true;
        }
Exemple #29
0
 public Controller(View.View view)
 {
     this.View = view;
 }
Exemple #30
0
        public QueryModel GetQueryModel(View.View view)
        {
            QueryModel result = new QueryModel();

            result.Table = new Soway.Query.Entity.IQueryTable()
            {
                DBName   = view.Model.DataTableName,
                ShowName = view.Model.Name
            };
            result.Columns = new List <ModelQueryCol>();

            foreach (var viewItem in view.Items.Where(p => p.Property.IsArray == false))
            {
                var property = viewItem.Property;
                if (property.IsMultiMap == false)
                {
                    ModelQueryCol col = new ModelQueryCol();
                    // col.Property = property;
                    col.ShowName   = viewItem.Name;
                    col.IsKey      = property.IsCheck;
                    col.DBName     = property.DBName;
                    col.FormatStr  = property.Format;
                    col.IsIdentity = (property.IsCheck && string.IsNullOrEmpty(property.IXGroup));
                    col.Table      = result.Table;
                    col.DataType   = property.PropertyType;
                    col.ID         = property.Name;
                    col.ModelId    = (property.Model == null ? 0 : property.Model.ID).ToString();

                    if (property.PropertyType == PropertyType.Enum && property.Model != null)
                    {
                        col.States = property.Model.EnumValues;
                    }
                    result.Columns.Add(col);
                    if (cols.ContainsKey(col) == false)
                    {
                        cols.Add(col, property);
                    }
                }
                else
                {
                    foreach (var dbmap in property.DBMaps)
                    {
                        ModelQueryCol col = new ModelQueryCol();
                        col.ShowName   = viewItem.Name + "_" + property.Model.Properties.FirstOrDefault(p => p.PropertyName == dbmap.PropertyName).Name;
                        col.IsKey      = false;// property.IsCheck;
                        col.DBName     = dbmap.DBColName;
                        col.FormatStr  = property.Format;
                        col.IsIdentity = false;
                        col.Table      = result.Table;
                        var mapProperty = property.Model.Properties.FirstOrDefault(p => p.Name == dbmap.PropertyName || p.PropertyName == dbmap.PropertyName);
                        col.DataType = property.PropertyType;
                        result.Columns.Add(col);
                        if (cols.ContainsKey(col) == false)
                        {
                            cols.Add(col, property);
                        }
                    }
                }
            }
            if (view.Model.AutoSysId == true)// || Model.IdProperty == null)
            {
                ModelQueryCol col = new ModelQueryCol();
                col.ShowName = "自动ID";
                col.IsKey    = true;// property.IsCheck;
                col.DBName   = "SysId";

                col.IsIdentity = true;// (property.IsCheck && string.IsNullOrEmpty(property.IXGroup));
                col.Table      = result.Table;
                // var mapProperty = property.Model.Properties.FirstOrDefault(p => p.Name == dbmap.PropertyName);
                //col.Property = null;

                col.DataType = PropertyType.IdentifyId;
                if (cols.ContainsKey(col) == false)
                {
                    cols.Add(col, null);
                }

                result.Columns.Add(col);
            }
            return(result);
        }
Exemple #31
0
        public void OpenResource(Panel parentPanel, PhactoryHost.Database.Resource resource)
        {
            View.View view = new View.View(resource);
            view.Parent = parentPanel;
            view.Dock = System.Windows.Forms.DockStyle.Fill;

            ResourceBinding resourceBinding = new ResourceBinding(parentPanel, view);
            viewBinding.Add(resource, resourceBinding);

            resourceBinding.View.Document = Host.XMLRead<Document.Document>(Host.GetFileInfo(resource).FullName);

            if (resourceBinding.View.Document is Document.Document)
            {
                if (Host.IsVerboseOutput())
                {
                    Host.Log(resource.DisplayName + " loaded");
                }
            }
            else
            {
                Host.Log("Problem while loading " + resource.DisplayName);
            }

            view.RefreshUI();
            view.RefreshTitle();

            view.IsReady = true;
        }
Exemple #32
0
        public void OpenResource(Panel parentPanel, PhactoryHost.Database.Resource resource)
        {
            View.View view = new View.View(resource);
            view.Parent = parentPanel;
            view.Dock = System.Windows.Forms.DockStyle.Fill;

            viewBinding.Add(resource, new ResourceBinding(parentPanel, view));

            view.RefreshContent();
            view.RefreshTitle();

            if (Host.IsVerboseOutput())
            {
                Host.Log(resource.DisplayName + " loaded");
            }

            view.IsReady = true;
        }
Exemple #33
0
 public QueryFactory(SqlCon con, Context.ICurrentContextFactory conFac)
 {
     this.Con     = con;
     this.ConFac  = conFac;
     relationView = new View.AutoViewFactory(this.Con, this.ConFac).CreateDefaultListView(relatoinModel);
 }
Exemple #34
0
 /// <summary>
 /// Invoke
 /// </summary>
 public void OnItemClick(AdapterView <object> adapterView, View.View view, int position, long id)
 {
     Invoke(adapterView, new ItemClickEventArgs(view, position, id));
 }
Exemple #35
0
 public ResourceBinding(Panel panel, View.View view)
 {
     this.Panel = panel;
     this.View  = view;
 }
Exemple #36
0
 public ResourceBinding(Panel panel, View.View view)
 {
     this.Panel = panel;
     this.View = view;
 }
Exemple #37
0
        public void RefreshViewTitle(PhactoryHost.Database.Resource resource)
        {
            View.View view = viewBinding[resource].View;

            view.RefreshTitle();
        }
Exemple #38
0
 public ServerController()
 {
     _view = new View.View();
 }
Exemple #39
0
 public void OnItemSelected(AdapterView <object> adapterView, View.View view, int position, long id)
 {
     ItemSelected.Invoke(adapterView, new ItemSelectedEventArgs(view, position, id));
 }
Exemple #40
0
 public void OnMovedToScrapHeap(View.View view)
 {
     MovedToScrapHeap.Invoke(null, new MovedToScrapHeapEventArgs(view));
 }