コード例 #1
0
ファイル: AppDelegate.cs プロジェクト: dreamsxin/engine-1
        // This method is invoked when the application has
        // loaded its UI and is ready to run
        public override Boolean FinishedLaunching(
			MonoTouch.UIKit.UIApplication app,
			MonoTouch.Foundation.NSDictionary options)
        {
            var appSettings = new AppSettings ("Blimey.Engine.Catasta.Demo") {
                MouseGeneratesTouches = true
            };

            var entryPoint = new BasicApp();

            IApi xamarinIOSApiImplementation = new Api ();
            platform = new Platform (xamarinIOSApiImplementation);
            platform.Start (appSettings, entryPoint);

            return true;
        }
コード例 #2
0
        public void FeedTemplateList(string appID
                                     , GlobalTemplateMembers.CannotDoTemplate canNotDo
                                     , FeedTemplateHeadFootItemTemplate head
                                     , FeedTemplateHeadFootItemTemplate foot
                                     , FeedTemplateListItemTemplate item)
        {
            Guid currentAppID;

            try
            {
                currentAppID = new Guid(appID);
            }
            catch
            {
                currentAppID = new BasicApp().AppID;
                //throw new Exception("非法的AppID");
            }


            FeedTemplateCollection feedTemplates;

            using (ErrorScope errorScope = new ErrorScope())
            {
                feedTemplates = FeedBO.Instance.GetFeedTemplates(currentAppID);
                errorScope.CatchError <ErrorInfo>(delegate(ErrorInfo error)
                {
                    canNotDo(error.Message);
                    return;
                });
            }

            int totalCount = feedTemplates.Count;

            AppBase currentApp = AppManager.GetApp(currentAppID);

            head(totalCount > 0, totalCount, currentApp);

            int i = 0;

            foreach (FeedTemplate feedTemplate in feedTemplates)
            {
                item(i++, feedTemplate, currentApp);
            }

            foot(totalCount > 0, totalCount, currentApp);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: dreamsxin/engine-1
        public static void Main(String[] args)
        {
            var appSettings = new AppSettings ("Blimey.Engine.Catasta.Demo") {
                FullScreen = true,
                MouseGeneratesTouches = true
            };

            var entryPoint = new BasicApp();

            IApi api = new Api ();

            using (var platform = new Platform (api))
            {
                platform.Start (appSettings, entryPoint);

                (api as Api).Run ();

                platform.Stop ();
            }
        }
コード例 #4
0
        private void SaveFeedTemplates()
        {
            MessageDisplay msgDisplay = CreateMessageDisplay("FeedTemplate.IconSrc", "FeedTemplate.Title", "FeedTemplate.Description");

            Guid   appID;
            string appIDString = _Request.Get("appID", Method.Get);

            if (appIDString == null)
            {
                appID = new BasicApp().AppID;
            }
            else
            {
                try
                {
                    appID = new Guid(appIDString);
                }
                catch
                {
                    msgDisplay.AddError(new InvalidParamError("appID").Message);
                    return;
                }
            }

            string[] ids = GetFeedTemplateIDs();
            if (ids != null)
            {
                FeedTemplateCollection feedTemplates = new FeedTemplateCollection();
                Dictionary <int, int>  lines         = new Dictionary <int, int>();
                int i = 0;
                foreach (string id in ids)
                {
                    //string changedKey = "FeedTemplate.Changed." + id;

                    //string changed = _Request.Get(changedKey, Method.Post, "0");

                    ////没改变就不保存
                    //if (changed == "0")
                    //    continue;



                    FeedTemplate feedTemplate = new FeedTemplate();
                    feedTemplate.AppID = appID;

                    LoadFeedTemplate(appID, id, feedTemplate);


                    feedTemplates.Add(feedTemplate);
                    lines.Add(i, int.Parse(id));
                    i++;
                }

                if (feedTemplates.Count > 0)
                {
                    try
                    {
                        using (new ErrorScope())
                        {
                            bool success = FeedBO.Instance.SetTemplates(MyUserID, appID, feedTemplates);
                            if (!success)
                            {
                                CatchError <ErrorInfo>(delegate(ErrorInfo error)
                                {
                                    msgDisplay.AddError(error.TatgetName, lines[error.TargetLine], error.Message);
                                });
                            }
                            else
                            {
                                _Request.Clear(Method.Post);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        msgDisplay.AddError(ex.Message);
                    }
                }
            }
        }