コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            button1       = UIButton.FromType(UIButtonType.RoundedRect);
            button1.Frame = new RectangleF(50, 20, 200, 40);
            button1.SetTitle("#myButton1 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button1, "myButton1");
            PXEngine.SetStyleClass(button1, "allButtons");

            button2       = UIButton.FromType(UIButtonType.RoundedRect);
            button2.Frame = new RectangleF(50, 70, 200, 40);
            button2.SetTitle("#myButton2 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button2, "myButton2");
            PXEngine.SetStyleClass(button2, "allButtons");

            button3       = UIButton.FromType(UIButtonType.RoundedRect);
            button3.Frame = new RectangleF(50, 120, 200, 40);
            button3.SetTitle("#myButton3 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button3, "myButton3");
            PXEngine.SetStyleClass(button1, "allButtons");

            PXEngine.SetStyleCSS(button3, "background-color: green; border-radius: 5;");

            this.View.AddSubview(button1);
            this.View.AddSubview(button2);
            this.View.AddSubview(button3);
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: ososorio-zz/cv-xamarin
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            PXEngine.LicenseKeyForUser("", "");

            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }
コード例 #3
0
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            //
            // ENTER YOUR LICENSE INFO HERE
            //
            PXEngine.LicenseKeyForUser("SERIAL NUMBER", "USER NAME");

            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }
コード例 #4
0
ファイル: AppDelegate.cs プロジェクト: markchipman/ProtoPad
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            _window = new UIWindow(UIScreen.MainScreen.Bounds);

            _viewController            = new MyViewController();
            _window.RootViewController = _viewController;

            _window.MakeKeyAndVisible();


            var pixateCssFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "protopad.css");

            File.WriteAllText(pixateCssFilePath, @"#button1 {
    border-radius    : 5px;
    font-family      : ""American Typewriter"";
    font-size        : 13px;
    font-weight      : bold;
    text-transform   : uppercase;
    letter-spacing   : 0.75px;
    color            : #ffffff;
    background-color : #008ed4;
}");

            var styleSheet = PXEngine.StyleSheetFromFilePathWithOrigin(pixateCssFilePath, PXStylesheetOrigin.PXStylesheetOriginApplication);

            styleSheet.MonitorChanges = true;

            // Create the ProtoPad server and start listening for messages from the ProtoPad Client.
            _protoPadServer = ProtoPadServer.Create(this, _window);
            _protoPadServer.AddPixateCssPath(pixateCssFilePath);

            // And that's it!
            // ProtoPad Client should be able to automatically discover this app on your local wifi network (through multicast discovery)
            // The ProtoPad Client will be able to issue any code to this app, and that code will be able to inspect and alter your activity to any extent.
            // So get prototyping :-)

            var ipAddressLabel = new UILabel(new RectangleF(0, 0, _window.Bounds.Width, 100))
            {
                Text          = string.Format("Connect ProtoPad Client to me on {0}:{1}", _protoPadServer.LocalIPAddress, _protoPadServer.ListeningPort),
                LineBreakMode = UILineBreakMode.WordWrap,
                Lines         = 0,
            };

            _window.AddSubview(ipAddressLabel);

            return(true);
        }
コード例 #5
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            window.RootViewController = new MyViewController();

            // make the window visible
            window.MakeKeyAndVisible();

            // Print the version an build date
            Console.WriteLine("Pixate Engine v{0} {1}", PXEngine.Version, PXEngine.BuildDate);

            // Print the location of the current application-level stylesheet
            Console.WriteLine("CSS File location: {0}", PXEngine.CurrentApplicationStylesheet().FilePath);

            // Monitor for changes in the stylesheet and update styles live
            PXEngine.CurrentApplicationStylesheet().MonitorChanges = true;

            return(true);
        }