Inheritance: MonoBehaviour
示例#1
0
		private static Shell ConvertCaiDaoDataRowToShell(DataRow row)
		{
			var shell = new Shell();

			shell.Id = row["ID"].ToString();
			shell.TargetId = row["Note"].ToString();
			shell.TargetLevel = row["TypeName"].ToString();
			shell.Status = "";

			shell.ShellUrl = row["SiteUrl"].ToString();
			shell.ShellPwd = row["SitePass"].ToString();
			shell.ShellType = GetScriptTypeById(Convert.ToInt32(row["nScript"].ToString()));
			shell.ShellExtraString = row["Config"].ToString();
			shell.ServerCoding = "UTF-8";
			shell.WebCoding = "UTF-8";

			shell.Area = "";
			shell.Remark = row["Note"].ToString();

			// convert time
			DateTime time;
			var success = DateTime.TryParse(row["AccessTime"].ToString(), out time);
			if (!success) time = DateTime.Now;
			var timeStr = time.Date.ToShortDateString();
			if (timeStr.Contains("/"))
			{
				timeStr = timeStr.Replace("/", "-");
			}
			shell.AddTime = timeStr;

			return shell;
		}
示例#2
0
    public static void Main()
    {
        var shell = new Shell();
        string cmd = string.Empty;
        while(true)
        {
            Console.Write("> ");
            cmd = Console.ReadLine();
            if(cmd == null || cmd == "quit" || cmd == "exit")
            {
                return;
            }

            try
            {
                var success = shell.Command(cmd);
                if(!success)
                {
                    Console.WriteLine("Invalid command " + cmd);
                }
            }
            catch(Exception ex)
            {
                Console.WriteLine(cmd);
                Console.WriteLine(ex);
            }
        }
    }
        public void ShouldRunBatchFileBeforeRunningTargets()
        {
            UnzipSolution();

            FileSystemTestHelper.RecreateDirectory(@"BeforeBounceFeature\bounce");

            //as there is a circular dependancy between BeforeBounceFeature.sln and the main bounce dll's
            //this needs to be run and built under the same framework version
            #if (FRAMEWORKV35)
            File.WriteAllText(@"BeforeBounceFeature\bounce\beforebounce.bat", @"%SystemRoot%\Microsoft.NET\Framework\v3.5\msbuild.exe BeforeBounceFeature.sln /p:Configuration=Debug_3_5");
            #else
            File.WriteAllText(@"BeforeBounceFeature\bounce\beforebounce.bat", @"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe BeforeBounceFeature.sln");
            #endif

            var shell = new Shell(new FakeLog());

            ProcessOutput output = null;

            FileSystemUtils.Pushd(@"BeforeBounceFeature", () => output = shell.Exec(@"..\bounce.exe", "BeforeBounceFeature"));

            Assert.That(output, Is.Not.Null);
            Assert.That(output.ExitCode, Is.EqualTo(0));
            Assert.That(output.Error.Trim(), Is.EqualTo(""));
            Assert.That(output.Output, Is.StringContaining("building before bounce feature"));
        }
示例#4
0
        private static void InvokeTestOptions(Shell shell, IShellCommand shellCommand, string[] args)
        {
            var prefixes = new[] { "--", "-", "/" };

            var optionsArgs = args
                .TakeWhile(x => prefixes.Any(p => x.StartsWith(p) && x.Length > p.Length))
                .ToList();

            var parser = new OptionSet();

            var options = (dynamic)new ExpandoObject();
            options.Verbosity = 0;

            parser
                .Add("c|config=", "Set config path", s => { if (!string.IsNullOrWhiteSpace(s)) options.ConfigPath = s; })
                .Add("v|verbose", "increase verbosity level", s => { if (s != null) options.Verbosity++; });

            var arguments = new List<string>(parser.Parse(optionsArgs));
            arguments.AddRange(args.Skip(optionsArgs.Count));

            options.Arguments = arguments;

            Console.WriteLine("Options:");
            Console.WriteLine(JsonConvert.SerializeObject(options, Formatting.Indented));
        }
示例#5
0
 public FileUploadOrDownload(IHost host, Shell shellData, string sourceFilePath, string targetFilePath)
 {
     _host = host;
     _shellData = shellData;
     _sourceFilePath = sourceFilePath;
     _targetFilePath = targetFilePath;
 }
示例#6
0
        public PanelDbManager(IHost host, PluginParameter data)
        {
			_host = host;
			_shellData = (Shell)data[0];
			_shellSqlConn = GetShellSqlConn();

			// init StrRes to translate string
			StrRes.SetHost(_host);
            Init();			

            //绑定事件
			_dbManager = new DbManager(_host, _shellData, _shellSqlConn.type);
			_dbManager.ConnectDbCompletedToDo += DbManagerConnectDbCompletedToDo;
			_dbManager.GetDbNameCompletedToDo += DbManagerGetDbNameCompletedToDo;
			_dbManager.GetDbTableNameCompletedToDo += DbManagerGetTableNameCompletedToDo;
			_dbManager.GetColumnTypeCompletedToDo += DbManagerGetColumnTypeCompletedToDo;
			_dbManager.ExecuteReaderCompletedToDo += DbManagerExecuteReaderCompletedToDo;
			_dbManager.ExecuteNonQueryCompletedToDo += DbManagerExecuteNonQueryCompletedToDo;

			RefreshServerStatus(false);


	        if (string.IsNullOrEmpty(_shellSqlConn.type) || string.IsNullOrEmpty(_shellSqlConn.conn))
	        {
		        MessageBox.Show("shell's sqlConnection is null or space");
	        }
	        else
	        {
				//连接数据库
				_dbManager.ConnectDb(_shellSqlConn.conn);
	        }
        }
        static void Main(string[] args) {

			Shell Dispatch = new Shell ();


				if (args.Length == 0) {
					throw new ParserException ("No command specified");
					}

                if (IsFlag(args[0][0])) {


                    switch (args[0].Substring(1).ToLower()) {
						case "mesh/recrypt server" : {
							Usage ();
							break;
							}
						case "start" : {
							Handle_Start (Dispatch, args, 1);
							break;
							}
						case "about" : {
							Handle_About (Dispatch, args, 1);
							break;
							}
						default: {
							throw new ParserException("Unknown Command: " + args[0]);
                            }
                        }
                    }
                else {
					Handle_Start (Dispatch, args, 0);
                    }
            } // Main
        public StreamingFindReferencesPresenter(
            Shell.SVsServiceProvider serviceProvider,
            ITextBufferFactoryService textBufferFactoryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            ClassificationTypeMap typeMap,
            IEditorFormatMapService formatMapService,
            [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
        {
            _serviceProvider = serviceProvider;
            _textBufferFactoryService = textBufferFactoryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService = editorOptionsFactoryService;
            _contentTypeRegistryService = contentTypeRegistryService;

            _textEditorFactoryService = textEditorFactoryService;
            _typeMap = typeMap;
            _formatMapService = formatMapService;

            _asyncListener = new AggregateAsynchronousOperationListener(
                asyncListeners, FeatureAttribute.ReferenceHighlighting);

            _vsFindAllReferencesService = (IFindAllReferencesService)_serviceProvider.GetService(typeof(SVsFindAllReferences));
        }
        protected override DependencyObject CreateShell()
        {
            Shell shell = new Shell();
            shell.Show();

            return shell;
        }
示例#10
0
        /// <summary>
        /// 	Initializes a new instance of the <see cref="TwiddlerApplication"/> class. 
        /// 	Launches an instance of Twiddler for testing.
        /// </summary>
        /// <param name="newStore">
        /// 	The new Store.
        /// </param>
        /// <returns>
        /// 	The launched instance.
        /// </returns>
        public TwiddlerApplication(bool newStore)
        {
            var args = new StringBuilder();

            args.Append(" /inMemory");
            args.AppendFormat(" /service={0}", DefaultService);

            string path = Path.GetFullPath(ApplicationPath);

            var startInfo = new ProcessStartInfo(path, args.ToString())
                                {
                                    UseShellExecute = false
                                };
            _application = Application.Launch(startInfo);

            try
            {
                Shell = new Shell(GetShellWindow());
            }
            catch (Exception)
            {
                if (!_application.HasExited)
                    _application.Kill();
                throw;
            }
        }
示例#11
0
    //시작하면 스포너별 길찾기
    void FindPath()
    {
        //Assign StartNode and Goal Node
        for (int i = 0; i < 4; i++) {
            startNode[i] = new Shell (GridManager.instance.GetGridCellCenter (GridManager.instance.GetGridIndex (oStart [i].transform.position)));
        }
        goalNode = new Shell(GridManager.instance.GetGridCellCenter(GridManager.instance.GetGridIndex(oEnd.transform.position)));

        //pathArray = AStar.FindPath(startNode, goalNode);
        pathOneArray = AStar.FindPath(startNode[0], goalNode);
        pathTwoArray = AStar.FindPath(startNode[1], goalNode);
        pathThrArray = AStar.FindPath(startNode[2], goalNode);
        pathFourArray = AStar.FindPath(startNode[3], goalNode);

        /*pathOneArray = AStar2.Path(oStart [0].transform.position, oEnd.transform.position);
        foreach(Node i in pathOneArray){
            Debug.Log ("path :"+ i.pos.x +" "+ i.pos.y +" "+ i.pos.z);
        }
        pathTwoArray = AStar2.Path(oStart [1].transform.position, oEnd.transform.position);
        pathThrArray = AStar2.Path(oStart [2].transform.position, oEnd.transform.position);
        pathFourArray = AStar2.Path(oStart [3].transform.position, oEnd.transform.position);*/

        if(bStart == false)
            StartCoroutine ("MoveLeader");

        bStart = true;
    }
 public SolutionRunner(ILog log, AppSettings settings, PortReservations reservations, Shell shell)
 {
     _log = log;
     _settings = settings;
     _reservations = reservations;
     _shell = shell;
 }
示例#13
0
        private double ScaleFactor; //Variable to hold the device scale factor (use to determine phone screen resolution)

        public Splash(SplashScreen splashscreen, Shell shell, bool loadState)
        {
            this.InitializeComponent();

            this.shell = shell;

            // Subscribe to changed size
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(Splash_OnResize);

            ScaleFactor = (double)DisplayInformation.GetForCurrentView().ResolutionScale / 100;

            splash = splashscreen;

            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);

                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();
            }

            CheckMedDatabaseUpdateAsync();
        }
        public override void ModifyMetadata(Shell.ObjectEditing.ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
        {
            base.ModifyMetadata(metadata, attributes);

            // We only want to select folders beneath the Gallery folder (163)
            metadata.EditorConfiguration["roots"] = new[] { new ContentReference(163) };
        }
        public void SetUp()
        {
            var registry = new Registry();
            shell = new Shell();
            shell.Register(registry);

            container = new Container(registry);
        }
示例#16
0
    public sType type; //셀의 타입

    #endregion Fields

    #region Constructors

    public Shell()
    {
        this.type = sType.NONE;
        this.estimatedCost = 0.0f;
        this.nodeTotalCost = 1.0f;
        this.bObstacle = false;
        this.parent = null;
    }
示例#17
0
 public Shell(INavigationService navigationService)
 {
     Instance = this;
     this.InitializeComponent();
     MyHamburgerMenu.NavigationService = navigationService;
     VisualStateManager.GoToState(Instance, Instance.NormalVisualState.Name, true);
     LinkNavigationManager.Start();
 }
 public override Shell.Framework.Commands.CommandState QueryState(Shell.Framework.Commands.CommandContext context)
 {
     if ((context.Items == null) || (context.Items.Length != 1))
         return Shell.Framework.Commands.CommandState.Hidden;
     else
         // if single item selected.
         return base.QueryState(context);
 }
示例#19
0
 public static void CloseShell()
 {
     if (shell != null)
     {
         shell.CloseSession();
         shell = null;
     }
 }
示例#20
0
 public void Detect(Shell shell, Tank tank)
 {
     var hit = IsHit(shell.Point, tank.Target);
     if (hit)
     {
         _notifyHitMethod(tank.Owner, shell);
     }
 }
		private static void Handle_Start (
					Shell Dispatch, string[] args, int index) {
			Start		Options = new Start ();

			var Registry = new Goedel.Registry.Registry ();

			Options.Address.Register ("address", Registry, (int) TagType_Start.Address);
			Options.PortalStore.Register ("log", Registry, (int) TagType_Start.PortalStore);
			Options.Verify.Register ("verify", Registry, (int) TagType_Start.Verify);

			// looking for parameter Param.Name}
			if (index < args.Length && !IsFlag (args [index][0] )) {
				// Have got the parameter, call the parameter value method
				Options.Address.Parameter (args [index]);
				index++;
				}

#pragma warning disable 162
			for (int i = index; i< args.Length; i++) {
				if 	(!IsFlag (args [i][0] )) {
					throw new System.Exception ("Unexpected parameter: " + args[i]);}			
				string Rest = args [i].Substring (1);

				TagType_Start TagType = (TagType_Start) Registry.Find (Rest);

				// here have the cases for what to do with it.

				switch (TagType) {
					case TagType_Start.PortalStore : {
						int OptionParams = Options.PortalStore.Tag (Rest);
						
						if (OptionParams>0 && ((i+1) < args.Length)) {
							if 	(!IsFlag (args [i+1][0] )) {
								i++;								
								Options.PortalStore.Parameter (args[i]);
								}
							}
						break;
						}
					case TagType_Start.Verify : {
						int OptionParams = Options.Verify.Tag (Rest);
						
						if (OptionParams>0 && ((i+1) < args.Length)) {
							if 	(!IsFlag (args [i+1][0] )) {
								i++;								
								Options.Verify.Parameter (args[i]);
								}
							}
						break;
						}
					default : throw new System.Exception ("Internal error");
					}
				}

#pragma warning restore 162
			Dispatch.Start (Options);

			}
示例#22
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif
            /*
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }
            */

            Shell shell = Window.Current.Content as Shell;
            if(shell==null)
            {
                shell = new Shell();
                Window.Current.Content = shell;
            }

            if (e.PrelaunchActivated == false)
            {
                
               /* if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                */
                if (!shell.DoesShowSomething())
                {
                    shell.ShowDefaultPage();
                }
                // Ensure the current window is active
                Window.Current.Activate();
            }
        }
示例#23
0
    /// <summary>
    //Constructor with adding position to the node creation
    /// </summary>
    public Shell(Vector3 pos)
    {
        this.type = sType.NONE;
        this.estimatedCost = 0.0f;
        this.nodeTotalCost = 1.0f;
        this.bObstacle = false;
        this.parent = null;

        this.position = pos;
    }
示例#24
0
        public void CanSendKeysToBrowser()
        {
            var shell = new Shell();

            var browserWindow = shell.Windows
                .Where(x => x.Text.Contains("muyou"))
                .SingleOrDefault();

            browserWindow.PressKey("Enter");
        }
示例#25
0
        public void FactMethodName1()
        {
            var shell = new Shell();

            var notepad = shell.Windows
                .Where(x => x.Text.Contains("Notepad"))
                .SingleOrDefault();

            notepad.PressKey("+ ` 1 . 0 1 2 3 4 5 6 7 8 9");
        }
示例#26
0
文件: Shell.cs 项目: mono/heap-prof
    public static void Main(string[] args)
    {
        Shell s;
        Application.Init ();
        s = new Shell ();

        if (args.Length == 1)
            s.Open (args [0]);
        s.ShowAll ();
        Application.Run ();
    }
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            if (shell == null)
            {
                this.shell = new Shell();
                Window.Current.Content = shell;
                shell.Navigate(typeof(MainView));
            }

            Window.Current.Activate();
        }
示例#28
0
        public void FactMethodName4()
        {
            var shell = new Shell();

            var notepad = shell.Windows
                .Where(x => x.Text.Contains("Notepad"))
                .SingleOrDefault();

            notepad.InputMode = InputMode.Post;
            notepad.PressKey("F5");
        }
示例#29
0
        public void FactMethodName3()
        {
            var shell = new Shell();

            var notepad = shell.Windows
                .Where(x => x.Text.Contains("Notepad"))
                .SingleOrDefault();

            notepad.Minimize();
            notepad.Maximize();
        }
示例#30
0
        public static void HandleDoShellExecute(Packets.ServerPackets.DoShellExecute command, Client client)
        {
            string input = command.Command;

            if (_shell == null && input == "exit") return;
            if (_shell == null) _shell = new Shell();

            if (input == "exit")
                CloseShell();
            else
                _shell.ExecuteCommand(input);
        }
示例#31
0
 public static Shell FlyoutIcon(this Shell shell, ImageSource source)
 {
     shell.FlyoutIcon = source;
     return(shell);
 }
示例#32
0
 public FileManager(IHost host, Shell data)
 {
     this._host      = host;
     this._shellData = data;
 }
 public EditDescrip_Title_Town_StreetPage()
 {
     InitializeComponent();
     Shell.SetTabBarIsVisible(this, false);
 }
示例#34
0
 public static Shell FlyoutBackgroundImage(this Shell shell, ImageSource source)
 {
     shell.FlyoutBackgroundImage = source;
     return(shell);
 }
示例#35
0
        public override void BeforePatch()
        {
            var LP22 = PrefabBuilder.Custom(() => CPUFP.createCube(2, 2))
                       .WithInput(CPUFP.getPegPos(2, 2, "L", 0.5f, 0f), CPUFP.getPegQuat("L"), "Reset Processor / Update Code")
                       .WithInput(CPUFP.getPegPos(2, 2, "L", -0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code Location")
                       .WithInput(CPUFP.getPegPos(2, 2, "R", 0.5f, 0f), CPUFP.getPegQuat("R"), "Clock")
                       .WithInput(CPUFP.getPegPos(2, 2, "B", -0.5f, 0f), CPUFP.getPegQuat("B"), "Input 0")
                       .WithInput(CPUFP.getPegPos(2, 2, "B", 0.5f, 0f), CPUFP.getPegQuat("B"), "Input 1")
                       .WithOutput(CPUFP.getPegPos(2, 2, "F", 0.5f, 0f), CPUFP.getPegQuat("F"), "Output 0")
                       .WithOutput(CPUFP.getPegPos(2, 2, "F", -0.5f, 0f), CPUFP.getPegQuat("F"), "Output 1");

            ComponentRegistry.CreateNew <Processor>("LogiProcessors22", "Processor 2 Bit IO", LP22);

            var LP44 = PrefabBuilder.Custom(() => CPUFP.createCube(4, 4))
                       .WithInput(CPUFP.getPegPos(4, 4, "L", 0.5f, 0f), CPUFP.getPegQuat("L"), "Reset Processor / Update Code")
                       .WithInput(CPUFP.getPegPos(4, 4, "L", -0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code Location")
                       .WithInput(CPUFP.getPegPos(4, 4, "R", 1.5f, 0f), CPUFP.getPegQuat("R"), "Clock")
                       .WithInput(CPUFP.getPegPos(4, 4, "B", -1.5f, 0f), CPUFP.getPegQuat("B"), "Input 0")
                       .WithInput(CPUFP.getPegPos(4, 4, "B", -0.5f, 0f), CPUFP.getPegQuat("B"), "Input 1")
                       .WithInput(CPUFP.getPegPos(4, 4, "B", 0.5f, 0f), CPUFP.getPegQuat("B"), "Input 2")
                       .WithInput(CPUFP.getPegPos(4, 4, "B", 1.5f, 0f), CPUFP.getPegQuat("B"), "Input 3")
                       .WithOutput(CPUFP.getPegPos(4, 4, "F", 1.5f, 0f), CPUFP.getPegQuat("F"), "Output 0")
                       .WithOutput(CPUFP.getPegPos(4, 4, "F", 0.5f, 0f), CPUFP.getPegQuat("F"), "Output 1")
                       .WithOutput(CPUFP.getPegPos(4, 4, "F", -0.5f, 0f), CPUFP.getPegQuat("F"), "Output 2")
                       .WithOutput(CPUFP.getPegPos(4, 4, "F", -1.5f, 0f), CPUFP.getPegQuat("F"), "Output 3");

            ComponentRegistry.CreateNew <Processor>("LogiProcessors44", "Processor 4 Bit IO", LP44);

            var LP88 = PrefabBuilder.Custom(() => CPUFP.createCube(8, 8))
                       .WithInput(CPUFP.getPegPos(8, 8, "L", 0.5f, 0f), CPUFP.getPegQuat("L"), "Reset Processor / Update Code")
                       .WithInput(CPUFP.getPegPos(8, 8, "L", -0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code Loc")
                       .WithInput(CPUFP.getPegPos(8, 8, "R", 3.5f, 0f), CPUFP.getPegQuat("R"), "Clock")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", -3.5f, 0f), CPUFP.getPegQuat("B"), "Input 0")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", -2.5f, 0f), CPUFP.getPegQuat("B"), "Input 1")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", -1.5f, 0f), CPUFP.getPegQuat("B"), "Input 2")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", -0.5f, 0f), CPUFP.getPegQuat("B"), "Input 3")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", 0.5f, 0f), CPUFP.getPegQuat("B"), "Input 4")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", 1.5f, 0f), CPUFP.getPegQuat("B"), "Input 5")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", 2.5f, 0f), CPUFP.getPegQuat("B"), "Input 6")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", 3.5f, 0f), CPUFP.getPegQuat("B"), "Input 7")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", 3.5f, 0f), CPUFP.getPegQuat("F"), "Output 0")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", 2.5f, 0f), CPUFP.getPegQuat("F"), "Output 1")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", 1.5f, 0f), CPUFP.getPegQuat("F"), "Output 2")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", 0.5f, 0f), CPUFP.getPegQuat("F"), "Output 3")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", -0.5f, 0f), CPUFP.getPegQuat("F"), "Output 4")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", -1.5f, 0f), CPUFP.getPegQuat("F"), "Output 5")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", -2.5f, 0f), CPUFP.getPegQuat("F"), "Output 6")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", -3.5f, 0f), CPUFP.getPegQuat("F"), "Output 7");

            ComponentRegistry.CreateNew <Processor>("LogiProcessors88", "Processor 8 Bit IO", LP88);

            var LP1616 = PrefabBuilder.Custom(() => CPUFP.createCube(8, 17))
                         .WithInput(CPUFP.getPegPos(8, 17, "L", 0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code / Reset Processor")
                         .WithInput(CPUFP.getPegPos(8, 17, "L", -0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code Loc")
                         .WithInput(CPUFP.getPegPos(8, 17, "R", 3.5f, 0f), CPUFP.getPegQuat("R"), "Clock")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 1f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 0")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 2f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 1")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 3f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 2")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 4f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 3")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 5f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 4")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 6f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 5")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 7f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 6")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 8f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 7")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -8f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 0")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -7f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 1")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -6f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 2")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -5f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 3")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -4f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 4")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -3f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 5")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -2f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 6")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -1f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 7")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -1f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 0")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -2f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 1")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -3f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 2")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -4f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 3")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -5f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 4")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -6f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 5")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -7f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 6")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -8f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 7")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 8f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 0")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 7f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 1")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 6f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 2")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 5f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 3")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 4f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 4")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 3f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 5")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 2f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 6")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 1f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 7");

            ComponentRegistry.CreateNew <Processor>("LogiProcessors1616", "Processor 2 Port IO", LP1616);

            Shell.RegisterCommand <setCodeLoc>();
        }
示例#36
0
 public static Shell FlyoutFooter(this Shell shell, object footer)
 {
     shell.FlyoutFooter = footer;
     return(shell);
 }
示例#37
0
 public static Shell FlyoutBackground(this Shell shell, Brush brush)
 {
     shell.FlyoutBackground = brush;
     return(shell);
 }
示例#38
0
        public void ShellPropagatesRightToLeftChangetoNewElements()
        {
            Button      button = new Button();
            StackLayout flyout = new StackLayout();
            Shell       shell  = new Shell()
            {
                Visual = Maui.Controls.VisualMarker.Default,
                Items  =
                {
                    new ShellItem()
                    {
                        Items =
                        {
                            new ShellSection()
                            {
                                Items =
                                {
                                    new ShellContent()
                                    {
                                        Content = new ContentPage()
                                        {
                                            Content = new Label()
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };

            shell.FlowDirection = FlowDirection.RightToLeft;
            shell.FlyoutHeader  = flyout;
            shell.Items.Add(
                new ShellItem()
            {
                Items =
                {
                    new ShellSection()
                    {
                        Items =
                        {
                            new ShellContent()
                            {
                                Content = new ContentPage()
                                {
                                    Content = button
                                }
                            }
                        }
                    }
                }
            });

            var buttonVisualController      = (button as IViewController).EffectiveFlowDirection;
            var stacklayoutVisualController = (flyout as IViewController).EffectiveFlowDirection;

            Assert.IsTrue(buttonVisualController.IsImplicit(), "EffectiveFlowDirection should be Implicit");
            Assert.IsTrue(!buttonVisualController.IsExplicit(), "EffectiveFlowDirection should be Implicit");
            Assert.IsTrue(!buttonVisualController.IsLeftToRight(), "EffectiveFlowDirection should be RightToLeft");
            Assert.IsTrue(buttonVisualController.IsRightToLeft(), "EffectiveFlowDirection should be RightToLeft");

            Assert.IsTrue(stacklayoutVisualController.IsImplicit(), "EffectiveFlowDirection should be Implicit");
            Assert.IsTrue(!stacklayoutVisualController.IsExplicit(), "EffectiveFlowDirection should be Implicit");
            Assert.IsTrue(!stacklayoutVisualController.IsLeftToRight(), "EffectiveFlowDirection should be RightToLeft");
            Assert.IsTrue(stacklayoutVisualController.IsRightToLeft(), "EffectiveFlowDirection should be RightToLeft");
        }
示例#39
0
 public static Shell FlyoutHeaderTemplate(this Shell shell, DataTemplate template)
 {
     shell.FlyoutHeaderTemplate = template;
     return(shell);
 }
示例#40
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        //print("Shell hit " + other.name);
        bool explode = false;

        if (other.name == "Tilemap")
        {
            Tilemap    map           = other.GetComponent <Tilemap>();
            Grid       grid          = map.GetComponentInParent <Grid>();
            Vector3    cellSize      = grid.cellSize;
            Vector3Int roundPosition = Vector3Int.FloorToInt(new Vector3(TopLeft.position.x / cellSize.x, TopLeft.position.y / cellSize.y, 0));
            TileBase   tile          = map.GetTile(roundPosition);

            if (tile.name == "brickwall")
            {
                map.SetTile(roundPosition, emptyTile);
                explode = true;
            }
            else if (tile.name == "steelwall")
            {
                if (damage == 2)
                {
                    map.SetTile(roundPosition, emptyTile);
                }
                explode = true;
            }
            roundPosition = Vector3Int.FloorToInt(new Vector3(TopRight.position.x / cellSize.x, TopRight.position.y / cellSize.y, 0));
            tile          = map.GetTile(roundPosition);

            if (tile.name == "brickwall")
            {
                map.SetTile(roundPosition, emptyTile);
                explode = true;
            }
            else if (tile.name == "steelwall")
            {
                if (damage == 2)
                {
                    map.SetTile(roundPosition, emptyTile);
                }
                explode = true;
            }
        }
        else if (other.name == "EnemyTank" || other.name == "player1" || other.name == "player2")
        {
            Tank targetTank = other.GetComponent <Tank>();
            if (shooter * targetTank.m_PlayerNumber < 0)
            {
                explode = true;
            }
        }
        else if (other.name == "Shell")
        {
            Shell shell = other.GetComponent <Shell>();
            if (shell.shooter * shooter < 0)
            {
                explode = true;
            }
        }
        if (explode)
        {
            StartCoroutine(Explode());
        }
    }
示例#41
0
		ContentPage GetContentPage(Color color)
		{
			var stackLayout = new StackLayout()
			{
				Children =
				{
					new Label() { Text = $"I should have a {color} background"},
					new Button()
					{
						Text = "Push Purple Page",
						Command = new Command(() =>
						{
							var contentPage = GetContentPage(Color.Purple);
							Navigation.PushAsync(contentPage);
						}),
					},
				}
			};

			if (Navigation?.NavigationStack != null)
			{
				stackLayout.Children.Add(new Button()
				{
					Text = "Insert Orange Page Before Current Page",
					Command = new Command(() =>
					{
						var contentPage = GetContentPage(Color.Orange);
						Navigation.InsertPageBefore(contentPage, Navigation.NavigationStack.Last());
					}),
				});

				stackLayout.Children.Add(new Button()
				{
					Text = "Pop Page",
					Command = new Command(() =>
					{
						Navigation.PopAsync();
					}),
				});

				stackLayout.Children.Add(new Button()
				{
					Text = "Remove Current Page",
					Command = new Command(() =>
					{
						Navigation.RemovePage(Navigation.NavigationStack.Last());
					}),
				});

				stackLayout.Children.Add(new Button()
				{
					Text = "Pop To Root",
					Command = new Command(() =>
					{
						Navigation.PopToRootAsync();
					}),
				});
			}

			var page = new ContentPage()
			{
				Title = color.ToString(),
				Content = stackLayout
			};

			Shell.SetBackgroundColor(page, color);
			return page;
		}
示例#42
0
 public static Shell ItemTemplate(this Shell shell, DataTemplate template)
 {
     shell.ItemTemplate = template;
     return(shell);
 }
示例#43
0
 public static Shell FlyoutSize(this Shell shell, double width, double height)
 {
     return(shell.FlyoutWidth(width).FlyoutHeight(height));
 }
示例#44
0
 public static Shell FlyoutWidth(this Shell shell, double width)
 {
     shell.FlyoutWidth = width;
     return(shell);
 }
示例#45
0
 public static Shell FlyoutHeader(this Shell shell, object header)
 {
     shell.FlyoutHeader = header;
     return(shell);
 }
 void back_Click(object sender, EventArgs e)
 {
     Shell.GoPrev();
 }
示例#47
0
 public static Shell FlyoutContent(this Shell shell, View content)
 {
     shell.FlyoutContent = content;
     return(shell);
 }
 void cancel_Click(object sender, EventArgs e)
 {
     Shell.Cancel();
 }
示例#49
0
 public static Shell FlyoutBackdrop(this Shell shell, Brush brush)
 {
     shell.FlyoutBackdrop = brush;
     return(shell);
 }
示例#50
0
 void finish_Click(object sender, System.EventArgs e)
 {
     Shell.Exit();
 }
示例#51
0
 public static Shell CurrentItem(this Shell shell, ShellItem item)
 {
     shell.CurrentItem = item;
     return(shell);
 }
示例#52
0
        void UpdateUseSafeArea()
        {
            if (Element == null)
            {
                return;
            }

            if (_userOverriddenSafeArea)
            {
                return;
            }

            if (!IsPartOfShell && !Forms.IsiOS11OrNewer)
            {
                return;
            }

            var tabThickness = _tabThickness;

            if (!_isInItems)
            {
                tabThickness = 0;
            }

            Thickness safeareaPadding = default(Thickness);

            if (Page.Padding != SafeAreaInsets)
            {
                _userPadding = Page.Padding;
            }

            if (Forms.IsiOS11OrNewer)
            {
                var insets = NativeView.SafeAreaInsets;
                if (Page.Parent is TabbedPage)
                {
                    insets.Bottom = 0;
                }

                safeareaPadding = new Thickness(insets.Left, insets.Top + tabThickness, insets.Right, insets.Bottom);
                Page.On <PlatformConfiguration.iOS>().SetSafeAreaInsets(safeareaPadding);
            }
            else if (IsPartOfShell)
            {
                safeareaPadding = new Thickness(0, TopLayoutGuide.Length + tabThickness, 0, BottomLayoutGuide.Length);
                Page.On <PlatformConfiguration.iOS>().SetSafeAreaInsets(safeareaPadding);
            }

            bool usingSafeArea = Page.On <PlatformConfiguration.iOS>().UsingSafeArea();
            bool isSafeAreaSet = Element.IsSet(PageSpecific.UseSafeAreaProperty);

            if (IsPartOfShell && !isSafeAreaSet)
            {
                if (Shell.GetNavBarIsVisible(Element) || _tabThickness != default(Thickness))
                {
                    usingSafeArea = true;
                }
            }

            if (!usingSafeArea && isSafeAreaSet && Page.Padding == safeareaPadding)
            {
                Page.SetValueFromRenderer(Page.PaddingProperty, _userPadding);
            }

            if (!usingSafeArea)
            {
                return;
            }

            if (SafeAreaInsets == Page.Padding)
            {
                return;
            }

            // this is determining if there is a UIScrollView control occupying the whole screen
            if (IsPartOfShell && !isSafeAreaSet)
            {
                var subViewSearch = View;
                for (int i = 0; i < 2 && subViewSearch != null; i++)
                {
                    if (subViewSearch?.Subviews.Length > 0)
                    {
                        if (subViewSearch.Subviews[0] is UIScrollView)
                        {
                            return;
                        }

                        subViewSearch = subViewSearch.Subviews[0];
                    }
                    else
                    {
                        subViewSearch = null;
                    }
                }
            }

            Page.SetValueFromRenderer(Page.PaddingProperty, SafeAreaInsets);
        }
示例#53
0
 public static Shell FlyoutBackgroundImageAspect(this Shell shell, Aspect aspect)
 {
     shell.FlyoutBackgroundImageAspect = aspect;
     return(shell);
 }
示例#54
0
 public static Shell BackgroundColor(this Shell shell, Color color)
 {
     shell.BackgroundColor = color;
     return(shell);
 }
示例#55
0
 private byte[] SubmitCommand(Shell shell, string funcNameXpath, string[] param)
 {
     return(Altman.Webshell.Service.SubmitCommand(shell, funcNameXpath, param));
 }
示例#56
0
 public override System.Object Exec(Computer computer, Shell shell, String[] args)
 {
     shell.PushMsg(GetPath(shell.filenode) + "\n");
     return(null);
 }
示例#57
0
        protected override void OnStart(string[] args)
        {
            var shell = new Shell();

            shell.StartWatching();
        }
示例#58
0
 public static Shell FlyoutHeaderBehavior(this Shell shell, FlyoutHeaderBehavior behavior)
 {
     shell.FlyoutHeaderBehavior = behavior;
     return(shell);
 }
示例#59
0
 public static Shell FlyoutIsPresented(this Shell shell, bool presented)
 {
     shell.FlyoutIsPresented = presented;
     return(shell);
 }
示例#60
0
 public static Shell FlyoutHeight(this Shell shell, double height)
 {
     shell.FlyoutHeight = height;
     return(shell);
 }