public override void WillDisplay(UITableView tableView, UITableViewCell cell, Foundation.NSIndexPath indexPath)
 {
     //			cell.SeparatorInset = UIEdgeInsets.Zero;
     //			cell.PreservesSuperviewLayoutMargins = false;
     //			cell.LayoutMargins = UIEdgeInsets.Zero;
     //
 }
		public override CoreGraphics.CGSize GetSizeForItem (UICollectionView collectionView, UICollectionViewLayout layout, Foundation.NSIndexPath indexPath)
		{
			if (Master.MaxHeight != 0) {
				return new CoreGraphics.CGSize ((Master.View.Frame.Size.Width - 10) / 3, Master.MaxHeight);
			}
			return new CoreGraphics.CGSize ((Master.View.Frame.Size.Width - padding - 10) / 3, (Master.View.Frame.Size.Width - padding - 10) / 3 + differential);
		}
		/// <summary>
		/// Called when the touches are cancelled due to a phone call, etc.
		/// </summary>
		public override void TouchesCancelled (Foundation.NSSet touches, UIEvent evt)
		{
			base.TouchesCancelled (touches, evt);
			// we fail the recognizer so that there isn't unexpected behavior
			// if the application comes back into view
			base.State = UIGestureRecognizerState.Failed;
		}
			public override UITableViewCell GetCell (UITableView tableView, Foundation.NSIndexPath indexPath)
			{
				var cell = tableView.DequeueReusableCell ("stringCell") ?? new UITableViewCell (UITableViewCellStyle.Default, "stringCell");
				if(Parent != null)
					cell.TextLabel.Text = Parent.filteredItems.ElementAt (indexPath.Row);
				return cell;
			}
예제 #5
0
		public override nfloat GetHeightForRow (UITableView tableView, Foundation.NSIndexPath indexPath)
		{
			if (!data.IsList && indexPath.Section == 0) {
				return indexPath.Row == 0 ? 66.0f : 22.0f;
			}
			return 44.0f;
		}
		public void InitalizeWithEmptyBuffer()
		{
			using (var foundation = new Foundation())
			{
				var stream = new DefaultMemoryOutputStream(new byte[] { });
			}
		}
예제 #7
0
        public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath)
        {
            cell = tableView.DequeueReusableCell ("instaReuseCell") as InstaTabControllerCell;
            cell.UpdateCell(mData [indexPath.Row].UserName, UIImage.FromFile (mData[indexPath.Row].ImageName),mData [indexPath.Row].Detail,mData [indexPath.Row].NumLikes, mData [indexPath.Row].NumComments,mData [indexPath.Row].PostDate,UIImage.FromFile (mData[indexPath.Row].PostImage) );

            return cell;
        }
		public override bool ShouldStartLoad (UIWebView webView, Foundation.NSUrlRequest request, UIWebViewNavigationType navigationType)
		{
			WebNavigationEvent navEvent = WebNavigationEvent.NewPage;
			switch (navigationType) {
			case UIWebViewNavigationType.LinkClicked:
				navEvent = WebNavigationEvent.NewPage;
				break;
			case UIWebViewNavigationType.FormSubmitted:
				navEvent = WebNavigationEvent.NewPage;
				break;
			case UIWebViewNavigationType.Reload:
				navEvent = WebNavigationEvent.Refresh;
				break;
			case UIWebViewNavigationType.FormResubmitted:
				navEvent = WebNavigationEvent.NewPage;
				break;
			case UIWebViewNavigationType.Other:
				navEvent = WebNavigationEvent.NewPage;
				break;
			}

			lastEvent = navEvent;

			Console.WriteLine ("[Custom Delegate] Url: {0}", request.Url);
			Console.WriteLine ("[Custom Delegate] MainDocUrl: {0}", request.MainDocumentURL);
			return true;
		}
		/// <summary>
		/// Called when the fingers move
		/// </summary>
		public override void TouchesMoved (Foundation.NSSet touches, UIEvent evt)
		{
			base.TouchesMoved (touches, evt);

			// if we haven't already failed
			if(base.State != UIGestureRecognizerState.Failed) {

				// get the current and previous touch point
				CGPoint newPoint = (touches.AnyObject as UITouch).LocationInView (View);
				CGPoint previousPoint = (touches.AnyObject as UITouch).PreviousLocationInView (View);

				// if we're not already on the upstroke
				if(!strokeUp) {

					// if we're moving down, just continue to set the midpoint at
					// whatever point we're at. when we start to stroke up, it'll stick
					// as the last point before we upticked
					if (newPoint.X >= previousPoint.X && newPoint.Y >= previousPoint.Y)
						midpoint = newPoint;
					// if we're stroking up (moving right x and up y [y axis is flipped])
					else if (newPoint.X >= previousPoint.X && newPoint.Y <= previousPoint.Y)
						strokeUp = true;
					// otherwise, we fail the recognizer
					else
						base.State = UIGestureRecognizerState.Failed;
				}
			}

			Console.WriteLine (base.State.ToString ());
		}
예제 #10
0
        public DefaultResolutionPipeline(Foundation foundation, IServiceLocatorAdapter adapter, IServiceLocatorStore store)
            : base(foundation, adapter, store)
        {
            var pipeline = new PostResolutionPipeline(foundation, adapter, store);

            Add(new AdapterPipelineItem(foundation, adapter, store, pipeline));
        }
예제 #11
0
        public FactoryResolutionPipeline(Foundation foundation, IServiceLocatorAdapter adapter, IServiceLocatorStore store)
        {
            var pipeline = new PostResolutionPipeline(foundation, adapter, store);

            Add(new ConditionalPipelineItem(foundation, adapter, store, pipeline));
            Add(new DefaultPipelineItem(foundation, adapter, store, pipeline));
        }
		public override UITableViewCell GetCell (UITableView tableView, Foundation.NSIndexPath indexPath)
		{
			UITableViewCell cell = tableView.DequeueReusableCell ( strCellIdentifier ) ?? new UITableViewCell ( UITableViewCellStyle.Default , strCellIdentifier );
			cell.TextLabel.Text = lstContacts [indexPath.Row].strContactName;
			cell.TextLabel.Font = UIFont.SystemFontOfSize (12);
			return cell;
		}
예제 #13
0
 public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath)
 {
     var cell = (PlayInfoCell)tableView.DequeueReusableCell(CELL_IDENT);
     var item = tableItems[indexPath.Row];
     cell.SetInformation(item, (indexPath.Row + 1));
     return cell;
 }
예제 #14
0
		public override void TouchesMoved (Foundation.NSSet touches, UIEvent evt)
		{

			swiped = true;
			UITouch touch = touches.AnyObject as UITouch;

			CGPoint currentPoint= touch.LocationInView (this);

			UIGraphics.BeginImageContext(Frame.Size);
			tempDrawImage.Image.Draw(new CGRect(0, 0, Frame.Size.Width, Frame.Size.Height));

			using (var context = UIGraphics.GetCurrentContext ())
			{

				context.MoveTo(lastPoint.X, lastPoint.Y);
				context.AddLineToPoint(currentPoint.X,currentPoint.Y);
				context.SetLineCap (CGLineCap.Round);
				context.SetLineWidth (brush);
				context.SetStrokeColor (PaintColor.CGColor);
				context.SetBlendMode (CGBlendMode.Normal);
				context.StrokePath ();


			}
			tempDrawImage.Image = UIGraphics.GetImageFromCurrentImageContext ();
			tempDrawImage.Alpha = opacity;
			UIGraphics.EndImageContext ();
			lastPoint = currentPoint;
		}
예제 #15
0
		public override void TouchesEnded (Foundation.NSSet touches, UIEvent evt)
		{

			if(!swiped) {

				UIGraphics.BeginImageContext(Frame.Size);
				tempDrawImage.Image.Draw (new CGRect(0, 0, Frame.Size.Width, Frame.Size.Height));

				using (var context = UIGraphics.GetCurrentContext ())
				{


					context.SetLineCap (CGLineCap.Round);
					context.SetLineWidth (brush);
					context.SetStrokeColor(PaintColor.CGColor);
					context.MoveTo(lastPoint.X, lastPoint.Y);
					context.AddLineToPoint(lastPoint.X, lastPoint.Y);
					context.StrokePath ();
					context.Flush ();
					tempDrawImage.Image = UIGraphics.GetImageFromCurrentImageContext ();
					UIGraphics.EndImageContext();

				}
			}


			UIGraphics.BeginImageContext(mainImage.Frame.Size);
			mainImage.Image.Draw(new CGRect(0, 0, Frame.Size.Width, Frame.Size.Height), CGBlendMode.Normal, 1.0f);
			tempDrawImage.Image.Draw (new CGRect(0, 0, Frame.Size.Width, Frame.Size.Height), CGBlendMode.Normal, opacity);
			mainImage.Image = UIGraphics.GetImageFromCurrentImageContext ();
			//tempDrawImage.Image = CreateImageFromColor ();
			UIGraphics.EndImageContext();

		}
		public override void FinishedLaunching (Foundation.NSObject notification)
		{
			if (mainFormFunc != null)
				main_form = mainFormFunc ();
			main_form.m_helper.MakeKeyAndOrderFront (this);
			main_form.m_helper.DidChangeScreen += delegate(object sender, EventArgs e) { main_form.m_helper.Display (); };
		}
예제 #17
0
		public override void TouchesBegan (Foundation.NSSet touches, UIKit.UIEvent evt)
		{

			swiped = false;
			UITouch touch = touches.AnyObject as UITouch ;
			lastPoint = touch.LocationInView (this);
		}
		public override void PerformSegue (string identifier, Foundation.NSObject sender) {
			base.PerformSegue (identifier, sender);

			var navigationList = new List<UIViewController> (this.NavigationController.ViewControllers);
			navigationList.RemoveAt (0);
			this.NavigationController.ViewControllers = navigationList.ToArray();
		}
 public override void SelectionDidChange (Foundation.NSNotification notification)
 {
     if (_callback != null)
     {
         _callback.SelectionDidChange();
     }
 }
예제 #20
0
 public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath)
 {
     var sb = UIStoryboard.FromName("Main", null);
     var ctrl = sb.InstantiateViewController("SignInViewController") as SignInViewController;
     ctrl.ApplyTheme = indexPath.Row == 1;
     NavigationController.PushViewController(ctrl, true);
 }
		public override void TouchesBegan (Foundation.NSSet touches, UIEvent evt)
		{
			foreach (var touch in touches) {
				CGPoint location = (touch as UITouch).LocationInNode (this);
				if (doneButton.ContainsPoint (location))
					PresentScene (new MainMenu (View.Bounds.Size));
			}
		}
예제 #22
0
        public override void TouchesMoved(Foundation.NSSet touches, UIKit.UIEvent evt)
        {
            base.TouchesMoved(touches, evt);

            System.Diagnostics.Debug.WriteLine("GestureSwitch: TouchesMoved");

            this.NextResponder.TouchesMoved(touches, evt);
        }
예제 #23
0
        public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath)
        {
            cell = tableView.DequeueReusableCell ("twitterHomeCell") as TwitterHomeCell;
                var item = mFeedList [indexPath.Row];
                cell.UpdateCell (item.User.Name, item.User.ProfileImageUrl, item.Text, item.User.ScreenNameResponse, item.CreatedAt);

            return cell;
        }
		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)
		{
			switch (editingStyle) {
			case UITableViewCellEditingStyle.Delete:
				TenServiceHelper.DeleteComment (Master.post, Master.TableItems [indexPath.Row], tableView, indexPath, Master.TableItems);
				break;
			}
		}
		public override void RowSelected (UITableView tableView, Foundation.NSIndexPath indexPath)
		{
			if ( ConatctRowSelectedEventAction != null )
			{
				ConatctRowSelectedEventAction ( lstContacts[indexPath.Row] );
			}
			tableView.DeselectRow ( indexPath , true );
		}
 public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath)
 {
     var cell = new UITableViewCell();
     cell.TextLabel.TextAlignment = UITextAlignment.Center;
     cell.TextLabel.Lines = 0;
     cell.TextLabel.Text = instructions.ElementAt(indexPath.Row).AsSentence();
     return cell;
 }
예제 #27
0
        public override void Process(Foundation.Common.Aspects.IMethodInvocationContext context)
        {
            PropertyInfo pi = context.Args[0].GetType().GetProperty(PropertyName);
            object value = pi.GetValue(context.Args[0], null);

            if (value == null)
                context.Cancel = true;
        }
예제 #28
0
        public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell(CELL_IDENT);
            var item = GetCellData(indexPath);
            cell.TextLabel.Text = string.Format("{0}, {1}", item.Name, item.Date);

            return cell;
        }
		public override nfloat GetHeightForRow (UITableView tableView, Foundation.NSIndexPath indexPath)
		{
			if (indexPath.Section == 0 && indexPath.Row == 1) {
				return 176;
			}

			return tableView.RowHeight;
		}
			public override void RowSelected (UITableView tableView, Foundation.NSIndexPath indexPath)
			{
				if (Parent == null)
					return;
				var item = Parent.filteredItems.ElementAt (indexPath.Row);
				Parent.ItemSelected (item);
				Parent.NavigationController.PopViewController(true);
			}
예제 #31
0
        public void GetValidMoves_skips_moves_which_are_whole_columns_to_empty_one()
        {
            /*
             * HH CC DD SS
             * 2H 4C 6D 8S
             *
             * aa bb cc dd
             * -- 6H -- JD
             *
             * 00 01 02 03 04 05 06 07
             * -- -- -- -- -- -- -- --
             * 9S    KH JS    9C 5C
             * QD    QC 8C    9D 6C
             * 7D    JH 3H    9H QH
             * TC    TS 7H    8H 8D
             * JC       KC    4H TD
             * TH       7C    KS 5H
             * QS             KD
             */
            var r     = Reserve.Create(null, "6H", null, "JD");
            var f     = Foundation.Create(Ranks.R2, Ranks.R4, Ranks.R6, Ranks.R8);
            var t0    = Tableau.Create("9S QD 7D TC JC TH QS");
            var t2    = Tableau.Create("KH QC JH TS");
            var t3    = Tableau.Create("JS 8C 3H 7H KC 7C");
            var t5    = Tableau.Create("9C 9D 9H 8H 4H KS KD");
            var t6    = Tableau.Create("5C 6C QH 8D TD 5H");
            var tRest = Tableau.Create();
            var ts    = Tableaus.Create(t0, tRest, t2, t3, tRest, t5, t6, tRest);
            var b     = Board.Create(r, f, ts);

            Assert.True(b.IsValid());

            // Act
            var moves = b.GetValidMoves().ToArray();

            // Assert
            Assert.Empty(moves.Where(m => m.Type == MoveType.TableauToTableau && m.From == 2 && m.Size == 4));
        }
        public async Task <ActionResult <FoundationPost> > Update([FromBody] FoundationPost model, int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(model));
            }

            Foundation foundation = await db.Foundation
                                    .Where(k => k.id_foundation == id)
                                    .FirstOrDefaultAsync();

            if (foundation == null)
            {
                return(NotFound(new {
                    ok = false,
                    err = "The id " + id + " does not exist in the records"
                }));
            }

            AssignsControllers.AssingFoundation(model, foundation);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (System.Exception err)
            {
                return(BadRequest(new {
                    ok = false,
                    err = err.InnerException.Message
                }));
            }

            return(Ok(new {
                ok = true,
                foundation
            }));
        }
예제 #33
0
        public static void InitSDK( )
        {
            void er( )
            {
            }

            Foundation fd = new Foundation(new ECB());

            pvd    = new Pvd(fd);
            py     = new PhysX.Physics(fd, true, pvd);
            SceneD = new SceneDesc
            {
                Gravity = new System.Numerics.Vector3(0, -9, 0)
            };
            Scene = py.CreateScene(SceneD);
            Scene.SetVisualizationParameter(VisualizationParameter.Scale, 2.0f);
            Scene.SetVisualizationParameter(VisualizationParameter.CollisionShapes, true);
            Scene.SetVisualizationParameter(VisualizationParameter.ActorAxes, true);
            py.Pvd.Connect("localhost");
            // Scene.Gravity = new System.Numerics.Vector3(0, 0, 0);

            //PhysX.Material dm = Scene.get
        }
예제 #34
0
        public void Search()
        {
            frmSearch s = new frmSearch(ModeType.Stock);

            if (s.ShowDialog(this.ParentForm) == DialogResult.OK)
            {
                string strGoodName = s.GoodsName;
                string strSql      = @"select Purchas.*,(incount - outcount) as stockcount,round(stockcount * inprice,2) as instat,goodsunit.UnitName,GoodsType.TypeName,Providers.ProviderName ";
                strSql += @"from Purchas,Providers,goodsunit,GoodsType ";
                strSql += "where Purchas.unitno = goodsunit.UnitNO and Providers.ProviderNO=purchas.providerno ";
                strSql += "and GoodsType.typeno=purchas.typeno and Purchas.goodsname";
                if (s.IsFuzzy)
                {
                    strSql += " like '%" + strGoodName + "%'";//recorddatetime like '" + Datetime + "%'");
                }
                else
                {
                    strSql += " ='" + strGoodName + "'";
                }
                DataSet ds = Foundation.ReadDataSet(strSql);
                LoadData(ds);
            }
        }
예제 #35
0
        public void LoadStockGoods()
        {
            this.tvStockGoods.Nodes.Clear();

            TreeNode all = new TreeNode(Foundation.AllGoodsName)
            {
                Tag = 0, ImageIndex = 0, SelectedImageIndex = 1
            };
            DataSet ds = Foundation.GetAllStockGoodsName();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                TreeNode sn = new TreeNode(dr["goodsname"].ToString())
                {
                    Tag = string.Empty, ImageIndex = 2, SelectedImageIndex = 3
                };
                all.Nodes.Add(sn);
            }

            this.tvStockGoods.Nodes.Add(all);
            this.tvStockGoods.SelectedNode = tvStockGoods.Nodes[0];
            this.tvStockGoods.ExpandAll();
        }
예제 #36
0
        public void FromSceneDescToScene()
        {
            if (Physics.Instantiated)
            {
                Assert.Fail("Physics is still created");
            }

            using (var foundation = new Foundation())
            {
                var physics = new Physics(foundation, checkRuntimeFiles: true);

                var bpc = new TestBroadPhaseCallback();

                var sceneDesc = new SceneDesc
                {
                    BroadPhaseCallback = bpc
                };

                var scene = physics.CreateScene(sceneDesc);

                Assert.AreEqual(bpc, scene.BroadPhaseCallback);
            }
        }
예제 #37
0
        public CocoaWebview(WebviewBridge bridge)
        {
            this.bridge = bridge ?? throw new ArgumentNullException(nameof(bridge));

            IntPtr configuration = WebKit.Call("WKWebViewConfiguration", "new");
            IntPtr manager       = ObjC.Call(configuration, "userContentController");

            callbackClass = CallbackClassDefinition.CreateInstance(this);
            schemeHandler = SchemeHandlerDefinition.CreateInstance(this);

            const string scheme = "spidereye";

            customHost = new Uri(UriTools.GetRandomResourceUrl(scheme));
            ObjC.Call(configuration, "setURLSchemeHandler:forURLScheme:", schemeHandler.Handle, NSString.Create(scheme));

            ObjC.Call(manager, "addScriptMessageHandler:name:", callbackClass.Handle, NSString.Create("external"));
            IntPtr script = WebKit.Call("WKUserScript", "alloc");

            ObjC.Call(
                script,
                "initWithSource:injectionTime:forMainFrameOnly:",
                NSString.Create(Resources.GetInitScript("Mac")),
                IntPtr.Zero,
                IntPtr.Zero);
            ObjC.Call(manager, "addUserScript:", script);

            Handle = WebKit.Call("WKWebView", "alloc");
            ObjC.Call(Handle, "initWithFrame:configuration:", CGRect.Zero, configuration);
            ObjC.Call(Handle, "setNavigationDelegate:", callbackClass.Handle);

            IntPtr boolValue = Foundation.Call("NSNumber", "numberWithBool:", false);

            ObjC.Call(Handle, "setValue:forKey:", boolValue, NSString.Create("drawsBackground"));
            ObjC.Call(Handle, "addObserver:forKeyPath:options:context:", callbackClass.Handle, NSString.Create("title"), IntPtr.Zero, IntPtr.Zero);

            preferences = ObjC.Call(configuration, "preferences");
        }
예제 #38
0
    void OnTriggerEnter(Collider other)
    {
        if (BuildingManager.building && other.tag == "Foundation" && foundationScript.isPlaced && !other.GetComponent <Foundation> ().isSnapped)
        {
            Foundation foundation = other.GetComponent <Foundation>();

            foundation.isSnapped = true;
            foundation.mousePosX = Input.GetAxis("horRot");
            foundation.mousePosX = Input.GetAxis("verRot");

            float sizeX = sizeOfFoundation.x;
            float sizeZ = sizeOfFoundation.z;

            #region Case statement for which collider we hit

            switch (this.transform.tag)
            {
            case "West Collider":
                other.transform.position = new Vector3(transform.parent.parent.position.x - sizeX, yOffset, transform.parent.position.z);
                break;

            case "East Collider":
                other.transform.position = new Vector3(transform.parent.parent.position.x + sizeX, yOffset, transform.parent.position.z);
                break;

            case "North Collider":
                other.transform.position = new Vector3(transform.parent.parent.position.x, yOffset, transform.parent.position.z + sizeZ);
                break;

            case "South Collider":
                other.transform.position = new Vector3(transform.parent.parent.position.x, yOffset, transform.parent.position.z - sizeZ);
                break;
            }

            #endregion
        }
    }
예제 #39
0
 /// <summary>
 /// Проверка автоматических перемещений в правую стопку из таблиц.
 /// </summary>
 private void CheckAutoMovesToRightFoundation()
 {
     for (int i = 0; i < GameTable.Tableaus; i++)
     {
         TableauView view = _tableauViews[i];
         if (!view.Tableau.CheckFillKingToAce())
         {
             continue;
         }
         // Найдена последовательность от короля до туза.
         // Ищем, куда её переместить.
         for (int j = 0; j < GameTable.Foundations; j++)
         {
             Foundation fn = _table.GetFoundation(j, false);
             if (fn.GetTopCard() == null)
             {
                 _table.MoveCards(view.Tableau.GetDraggableTopCards(), view.Tableau, fn);
                 break;
             }
         }
         RefreshView();
         CheckGameOver();
     }
 }
예제 #40
0
        public void Search()
        {
            frmSearch s = new frmSearch(ModeType.Stock);

            if (s.ShowDialog(this.ParentForm) == DialogResult.OK)
            {
                string strGoodName = s.GoodsName;
                string strSql      = @"select sell.*,round(sell.outcount * sell.outprice,2) as outstat,round(sell.outcount * (sell.outprice-purchas.inprice),2) as profit,";
                strSql += "purchas.goodsname,purchas.goodscode,purchas.fixprice,goodsunit.UnitName,GoodsType.TypeName,Providers.ProviderName ";
                strSql += "from Sell,purchas,goodsunit,Providers,GoodsType where Purchas.unitno = goodsunit.UnitNO and ";
                strSql += "Providers.ProviderNO=purchas.providerno and GoodsType.typeno=purchas.typeno and Sell.goodsno=purchas.goodsno and purchas.goodsname";

                if (s.IsFuzzy)
                {
                    strSql += " like '%" + strGoodName + "%'";//recorddatetime like '" + Datetime + "%'");
                }
                else
                {
                    strSql += " ='" + strGoodName + "'";
                }
                DataSet ds = Foundation.ReadDataSet(strSql);
                LoadDataNew(ds);
            }
        }
예제 #41
0
파일: Engine.cs 프로젝트: zhu1987/PhysX.Net
        protected virtual SceneDesc CreateSceneDesc(Foundation foundation)
        {
#if GPU
            var cudaContext = new CudaContextManager(foundation);
#endif

            var sceneDesc = new SceneDesc
            {
                Gravity = new Vector3(0, -9.81f, 0),
#if GPU
                GpuDispatcher = cudaContext.GpuDispatcher,
#endif
                FilterShader = new SampleFilterShader()
            };

#if GPU
            sceneDesc.Flags          |= SceneFlag.EnableGpuDynamics;
            sceneDesc.BroadPhaseType |= BroadPhaseType.Gpu;
#endif

            _sceneDescCallback?.Invoke(sceneDesc);

            return(sceneDesc);
        }
예제 #42
0
        public DialogResult Show(IWindow parent)
        {
            var window = parent as CocoaWindow;

            if (parent != null && window == null)
            {
                throw new ArgumentException("Invalid window type.", nameof(parent));
            }

            var dialog = CreateDialog();

            if (!string.IsNullOrWhiteSpace(InitialDirectory))
            {
                var url = Foundation.Call("NSURL", "fileURLWithPath:", NSString.Create(InitialDirectory));
                ObjC.Call(dialog.Handle, "setDirectoryURL:", url);
            }

            if (!string.IsNullOrWhiteSpace(FileName))
            {
                ObjC.Call(dialog.Handle, "setNameFieldStringValue:", NSString.Create(FileName));
            }

            ObjC.Call(dialog.Handle, "setTitle:", NSString.Create(Title));
            ObjC.Call(dialog.Handle, "setCanCreateDirectories:", true);
            SetFileFilters(dialog.Handle, FileFilters);

            int result = dialog.Run(window);

            var selection = ObjC.Call(dialog.Handle, "URL");

            FileName = NSString.GetString(ObjC.Call(selection, "path"));

            BeforeReturn(dialog);

            return(MapResult(result));
        }
예제 #43
0
        private unsafe void UpdateIcon(AppIcon?icon)
        {
            var image = IntPtr.Zero;

            if (icon != null && icon.Icons.Length > 0)
            {
                byte[] data = icon.GetIconData(icon.DefaultIcon);
                fixed(byte *dataPtr = data)
                {
                    IntPtr nsData = Foundation.Call(
                        "NSData",
                        "dataWithBytesNoCopy:length:freeWhenDone:",
                        (IntPtr)dataPtr,
                        new IntPtr(data.Length),
                        IntPtr.Zero);

                    image = AppKit.Call("NSImage", "alloc");
                    ObjC.Call(image, "initWithData:", nsData);
                    ObjC.Call(statusBarButton, "setImage:", image);
                }
            }

            ObjC.Call(statusBarButton, "setImage:", image);
        }
예제 #44
0
        public bool Save()
        {
            string strSql = @"insert into Purchas(goodsno,intime,goodsname,goodscode,unitno,typeno,providerno,incount,inprice,outcount,remarks,fixprice) ";

            strSql += @"values(@goodsno,@intime,@goodsname,@goodscode,@unitno,@typeno,@providerno,@incount,@inprice,@outcount,@remarks,@fixprice);";
            OleDbCommand cmd = new OleDbCommand(strSql, Foundation.CreateInstance());

            cmd.Parameters.AddWithValue("@goodsno", GoodsNO);
            cmd.Parameters.AddWithValue("@intime", InTime);
            cmd.Parameters.AddWithValue("@goodsname", GoodsName);
            cmd.Parameters.AddWithValue("@goodscode", GoodsCode);

            cmd.Parameters.AddWithValue("@unitno", UnitNO);
            cmd.Parameters.AddWithValue("@typeno", TypeNO);
            cmd.Parameters.AddWithValue("@providerno", ProviderNO);

            cmd.Parameters.AddWithValue("@incount", InCount);
            cmd.Parameters.AddWithValue("@inprice", InPrice);
            cmd.Parameters.AddWithValue("@outcount", 0);
            cmd.Parameters.AddWithValue("@remarks", Remarks);
            cmd.Parameters.AddWithValue("@fixprice", FixPrice);

            return(cmd.ExecuteNonQuery() > 0);
        }
예제 #45
0
 public ConditionalPostResolutionPipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store) : base(foundation, serviceLocator, store)
 {
     registrationStore = foundation.StoreFor <ConditionalPostResolutionStore>();
 }
예제 #46
0
 public void SetFoundation(Foundation foundation, Vector3 position)
 {
     _currentFoundation = foundation;
     transform.position = position;
     _view.SetActive(true);
 }
예제 #47
0
        protected override void OnShown(EventArgs e)
        {
            var foundation = new Foundation(new Errors());

            var physx = new PhysX.Physics(foundation, checkRuntimeFiles: true);

            var apex = new ApexSdk(physx);

            var destructibleModule = apex.CreateModule <PhysX.Apex.Modules.Destructible.DestructibleModule>();

            var desc = destructibleModule.GetDefaultModuleDesc();

            destructibleModule.Initalize(desc);

            var apexSceneDesc = new ApexSceneDesc
            {
                UseDebugRenderable = true
            };

            var apexScene = apex.CreateScene(apexSceneDesc);

            var serializer = apex.CreateSerializer(SerializeType.Binary, apexScene);

            using (var stream = new StreamReader(@"C:\Development\Temp\Cube3.apb"))
            {
                var d = serializer.Deserialize(stream.BaseStream);

                var p = d[0];

                var asset = apex.CreateAsset(p, "Cube2");

                var destructibleAsset = asset as DestructibleAsset;

                var descParams = destructibleAsset.GetDefaultActorDesc();

                bool valid = asset.IsValidForCreation(descParams, apexScene);

                var actor = asset.CreateApexActor(descParams, apexScene);

                var destructibleActor = actor as DestructibleActor;
            }

            //physx::PxFileBuf* stream = _apexSdk->createStream("C:\\Development\\Temp\\Cube2.apx", physx::PxFileBuf::OPEN_READ_ONLY);

            //NxParameterized::Serializer::DeserializedData data;
            //NxParameterized::Serializer::ErrorType serError = s->deserialize(*stream, data);

            //NxParameterized::Interface *params = data[0];
            //NxApexAsset* asset = _apexSdk->createAsset(params, "Asset Name");

            //NxDestructibleAsset* destructibleAsset = static_cast<NxDestructibleAsset*>(asset);

            //NxParameterized::Interface* descParams = destructibleAsset->getDefaultActorDesc();

            //bool valid = asset->isValidForActorCreation(*descParams, *scene->UnmanagedPointer);

            ////NxParameterized::setParamMat44(*descParams, "globalPose", pose);

            //NxApexActor* actor = asset->createApexActor(*descParams, *scene->UnmanagedPointer);

            //NxDestructibleActor* destructibleActor = (NxDestructibleActor*)actor;
        }
예제 #48
0
 void ProviderTree_AfterSelect(object sender, TreeViewEventArgs e)
 {
     LoadData(Foundation.GetStockGoodsProviderData(e.Node.Tag.ToString(), false));
 }
예제 #49
0
 private void frmGoods_Load(object sender, EventArgs e)
 {
     LoadData(Foundation.GetStockGoods(Foundation.AllGoodsName, false));
 }
예제 #50
0
        public void Awake()
        {
            Console.WriteLine("StartGame");
            //初始化物理
            ErrorOutput errorOutput = new ErrorOutput();
            Foundation  foundation  = new Foundation(errorOutput);

            //var pvd = new PhysX.VisualDebugger.ConnectionManager
            Physics = new Physics(foundation);
            var sceneDesc = new SceneDesc
            {
                Gravity      = new System.Numerics.Vector3(0, -9.81f, 0),
                FilterShader = new SampleFilterShader()
            };

            Scene = Physics.CreateScene(sceneDesc);

            this.Scene.SetVisualizationParameter(VisualizationParameter.Scale, 2.0f);
            this.Scene.SetVisualizationParameter(VisualizationParameter.CollisionShapes, true);
            this.Scene.SetVisualizationParameter(VisualizationParameter.JointLocalFrames, true);
            this.Scene.SetVisualizationParameter(VisualizationParameter.JointLimits, true);
            this.Scene.SetVisualizationParameter(VisualizationParameter.ActorAxes, true);

            Physics.PvdConnectionManager.Connect("localhost", 5425);

            //创建平面
            var groundPlaneMaterial = this.Scene.Physics.CreateMaterial(0.1f, 0.1f, 0.1f);
            var groundPlane         = this.Scene.Physics.CreateRigidStatic();

            groundPlane.GlobalPose = Matrix4x4.CreateFromAxisAngle(new System.Numerics.Vector3(0, 0, 1), (float)System.Math.PI / 2);
            groundPlane.Name       = "Ground Plane";
            var planeGeom = new PlaneGeometry();

            groundPlane.CreateShape(planeGeom, groundPlaneMaterial);
            this.Scene.AddActor(groundPlane);

            //创建角色
            var material          = Scene.Physics.CreateMaterial(0.1f, 0.1f, 0.1f);
            var controllerManager = Scene.CreateControllerManager();
            {
                var desc = new CapsuleControllerDesc()
                {
                    Height         = 4,
                    Radius         = 1,
                    Material       = material,
                    UpDirection    = new Vector3(0, 1, 0),
                    Position       = new Vector3(0, 3, 0),
                    ReportCallback = new ControllerHitReport()
                };

                _controller = controllerManager.CreateController <CapsuleController>(desc);
            }
            //再来一个不动的
            {
                var desc = new CapsuleControllerDesc()
                {
                    Height      = 4,
                    Radius      = 1,
                    Material    = material,
                    UpDirection = new Vector3(0, 1, 0),
                    Position    = new Vector3(15, 3, 15)
                };

                controllerManager.CreateController <CapsuleController>(desc);
            }
        }
예제 #51
0
        public void CanAutoPlay_tests(int hearts, int clubs, int diamonds, int spades, Card card, bool expectedCanAutoPlay)
        {
            var f = Foundation.Create(hearts, clubs, diamonds, spades);

            Assert.Equal(expectedCanAutoPlay, f.CanAutoPlay(card));
        }
예제 #52
0
 void Start()
 {
     foundationScript = transform.parent.parent.GetComponent <Foundation>();
     sizeOfFoundation = transform.parent.parent.GetComponent <Collider>().bounds.size;
 }
예제 #53
0
 public void Output()
 {
     Foundation.OutputCSV(this.lvRecording, "记帐" + System.DateTime.Now.ToString("yyyyMMddHHssmm") + ".csv");
 }
예제 #54
0
 protected BasePipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator, IServiceLocatorStore store)
 {
     this.foundation     = foundation;
     this.serviceLocator = serviceLocator;
     this.store          = store;
 }
예제 #55
0
 public UpdateDB()
 {
     m_appVer = Foundation.GetAppVersion();
 }
예제 #56
0
 public void Initialize()
 {
     found = new Foundation(Suit.Spades);
 }
예제 #57
0
    private void OnTriggerEnter(Collider other)
    {
        //Snapping
        if (BuildingManager.isBuilding && other.tag == "Foundation" && foundationScript.isPlaced && !other.GetComponent <Foundation>().isSnapped) // foundationScript.isPlaced
        {
            //Release Snapping
            Foundation foundation = other.GetComponent <Foundation>();
            foundation.isSnapped = true;
            foundation.mousePosX = Input.GetAxis("Mouse X");
            foundation.mousePosY = Input.GetAxis("Mouse Y");


            other.GetComponent <Foundation>().isSnapped = true;

            float sizeX = sizeOfFoundation.x;
            float sizeZ = sizeOfFoundation.z;

            if (BuildingManager.PreH)
            {
                switch (this.transform.tag)
                {
                case "WestCollider":
                    other.transform.position = new Vector3(transform.parent.parent.position.x - sizeX, 0, transform.parent.position.z);
                    break;

                case "EastCollider":
                    other.transform.position = new Vector3(transform.parent.parent.position.x + sizeX, 0, transform.parent.position.z);
                    break;

                case "NortCollider":
                    other.transform.position = new Vector3(transform.parent.parent.position.x, 0, transform.parent.position.z + sizeZ);
                    break;

                case "SouthCollider":
                    other.transform.position = new Vector3(transform.parent.parent.position.x, 0, transform.parent.position.z - sizeZ);
                    break;
                }
            }
            if (BuildingManager.PreV)
            {
                switch (this.transform.tag)
                {
                case "WestColliderVert":
                    other.transform.position    = new Vector3(transform.parent.parent.position.x - (sizeX / 2), 1, transform.parent.position.z);
                    other.transform.eulerAngles = new Vector3(90, 0, -90);
                    break;

                case "EastColliderVert":
                    other.transform.position    = new Vector3(transform.parent.parent.position.x + (sizeX / 2), 1, transform.parent.position.z);
                    other.transform.eulerAngles = new Vector3(-90, 0, 90);
                    break;

                case "NorthColliderVert":
                    other.transform.position = new Vector3(transform.parent.parent.position.x, 1, transform.parent.position.z + (sizeZ / 2));
                    break;

                case "SouthColliderVert":
                    other.transform.position = new Vector3(transform.parent.parent.position.x, 1, transform.parent.position.z - (sizeZ / 2));
                    break;
                }
            }
        }
    }
예제 #58
0
        public static void PrintBoard(Board board)
        {
            Console.OutputEncoding = UnicodeEncoding.Unicode;
            Console.Clear();
            String emptyStack      = " \u25a1 ";
            String empty           = "   ";
            String columnSeperator = "  ";

            StringBuilder toPrint = new StringBuilder();

            foreach (Suit s in SuitValues)
            {
                Foundation found = board.Foundations[s];
                if (found.CardList.Count == 0)
                {
                    toPrint.Append(emptyStack);
                }
                else
                {
                    toPrint.Append(found.CardList[found.CardList.Count - 1].ToPrintString());
                }
                toPrint.Append(columnSeperator);
            }
            toPrint.Append(columnSeperator);

            foreach (FreeSpace space in board.FreeSpaces)
            {
                if (space.CardList.Count == 0)
                {
                    toPrint.Append(emptyStack);
                }
                else
                {
                    toPrint.Append(space.CardList[0].ToPrintString());
                }
                toPrint.Append(columnSeperator);
            }
            toPrint.AppendLine();
            toPrint.AppendLine();
            for (int depth = 0; depth < 19; depth++)
            {
                for (int width = 0; width < 8; width++)
                {
                    Cascade casc = board.Cascades[width];
                    if (casc.CardList.Count < depth + 1)
                    {
                        toPrint.Append(empty);
                    }
                    else
                    {
                        Card c = casc.CardList[depth];
                        toPrint.Append(c.ToPrintString());
                    }
                    toPrint.Append(columnSeperator);
                }
                toPrint.AppendLine();
            }

            toPrint.Append(board.MoveList.Count);
            Console.Write(toPrint.ToString());
        }
예제 #59
0
        private void DGM_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
        {
            if (DGM.CurrentItem != null)
            {
                ItemIndexInDGM = DGM.Items.IndexOf(DGM.CurrentItem);
            }

            try
            {
                if (DGM.SelectedCells.Count > 0 && EXPCALC.IsExpanded)
                {
                    if (DGM.SelectedCells.Count == 1)
                    {
                        if (DGM.CurrentColumn.Header.ToString() == "Сума" &&
                            ((DBSolom.Financing)e.AddedCells[0].Item).Проведено != null &&
                            ((DBSolom.Financing)e.AddedCells[0].Item).Головний_розпорядник != null &&
                            ((DBSolom.Financing)e.AddedCells[0].Item).КЕКВ != null &&
                            ((DBSolom.Financing)e.AddedCells[0].Item).КФК != null &&
                            ((DBSolom.Financing)e.AddedCells[0].Item).Мікрофонд != null)
                        {
                            List <string> vs                  = Func.names_months;
                            double        yearSumFilling      = 0;
                            double        yearSumCorrection   = 0;
                            double        yearSumFinancing    = 0;
                            double        periodSumFilling    = 0;
                            double        periodSumCorrection = 0;
                            double        periodSumFinancing  = 0;

                            #region "Fiels of Cell"

                            DateTime        date         = ((DBSolom.Financing)e.AddedCells[0].Item).Проведено;
                            KFK             KFK          = ((DBSolom.Financing)e.AddedCells[0].Item).КФК;
                            Main_manager    Main_manager = ((DBSolom.Financing)e.AddedCells[0].Item).Головний_розпорядник;
                            KEKB            KEKB         = ((DBSolom.Financing)e.AddedCells[0].Item).КЕКВ;
                            Foundation      FOND         = ((DBSolom.Financing)e.AddedCells[0].Item).Мікрофонд.Фонд;
                            MicroFoundation MicroFond    = ((DBSolom.Financing)e.AddedCells[0].Item).Мікрофонд;

                            #endregion

                            DBSolom.Db mdb = new Db(Func.GetConnectionString);

                            #region "Foundation"

                            #region "Filling"

                            List <DBSolom.Filling> qfil = mdb.Fillings
                                                          .Include(i => i.Головний_розпорядник)
                                                          .Include(i => i.КФБ)
                                                          .Include(i => i.КДБ)
                                                          .Include(i => i.КЕКВ)
                                                          .Include(i => i.КФК)
                                                          .Include(i => i.Фонд)
                                                          .Where(w => w.Видалено == false &&
                                                                 w.Головний_розпорядник.Найменування == Main_manager.Найменування &&
                                                                 w.Проведено.Year == date.Year &&
                                                                 w.КЕКВ.Код == KEKB.Код &&
                                                                 w.КФК.Код == KFK.Код &&
                                                                 w.Фонд.Код == FOND.Код).ToList();

                            for (int j = 0; j < date.Month; j++)
                            {
                                periodSumFilling += qfil.Select(s => (double)s.GetType().GetProperty(vs[j]).GetValue(s)).Sum();
                            }
                            for (int j = 0; j < 11; j++)
                            {
                                yearSumFilling += qfil.Select(s => (double)s.GetType().GetProperty(vs[j]).GetValue(s)).Sum();
                            }

                            #endregion

                            #region "Correction"

                            List <DBSolom.Correction> qcorr = mdb.Corrections
                                                              .Include(i => i.Головний_розпорядник)
                                                              .Include(i => i.КФБ)
                                                              .Include(i => i.КДБ)
                                                              .Include(i => i.КЕКВ)
                                                              .Include(i => i.КФК)
                                                              .Include(i => i.Мікрофонд)
                                                              .Where(w => w.Видалено == false &&
                                                                     w.Головний_розпорядник.Найменування == Main_manager.Найменування &&
                                                                     w.Проведено.Year == date.Year &&
                                                                     w.КЕКВ.Код == KEKB.Код &&
                                                                     w.КФК.Код == KFK.Код &&
                                                                     w.Мікрофонд.Фонд.Код == FOND.Код).ToList();

                            for (int j = 0; j < date.Month; j++)
                            {
                                periodSumCorrection += qcorr.Select(s => (double)s.GetType().GetProperty(vs[j]).GetValue(s)).Sum();
                            }
                            for (int j = 0; j < 11; j++)
                            {
                                yearSumCorrection += qcorr.Select(s => (double)s.GetType().GetProperty(vs[j]).GetValue(s)).Sum();
                            }

                            #endregion

                            #region "Financing"

                            List <DBSolom.Financing> qfin = mdb.Financings.Where(w => w.Видалено == false &&
                                                                                 w.Головний_розпорядник.Найменування == Main_manager.Найменування &&
                                                                                 w.Проведено.Year == date.Year &&
                                                                                 w.КЕКВ.Код == KEKB.Код &&
                                                                                 w.КФК.Код == KFK.Код &&
                                                                                 w.Мікрофонд.Фонд.Код == FOND.Код).ToList();

                            db.Financings.Local.Where(w => w.Видалено == false &&
                                                      w.Головний_розпорядник.Найменування == Main_manager.Найменування &&
                                                      w.Проведено.Year == date.Year &&
                                                      w.КЕКВ.Код == KEKB.Код &&
                                                      w.КФК.Код == KFK.Код &&
                                                      w.Мікрофонд.Фонд.Код == FOND.Код)
                            .ToList()
                            .ForEach(item =>
                            {
                                if (db.Entry(item).State != EntityState.Unchanged)
                                {
                                    qfin.Add(item);
                                }
                            });

                            yearSumFinancing   = qfin.Select(s => s.Сума).Sum();
                            periodSumFinancing = qfin.Where(w => w.Проведено <= date).Select(s => s.Сума).Sum();

                            #endregion

                            GRPBYearFond.Content   = (yearSumFilling + yearSumCorrection - yearSumFinancing).ToString("N2", CultureInfo.CreateSpecificCulture("ru-RU"));
                            GRPBPeriodFond.Content = (periodSumFilling + periodSumCorrection - periodSumFinancing).ToString("N2", CultureInfo.CreateSpecificCulture("ru-RU"));
                            #endregion
                        }


                        double d;
                        if (double.TryParse(DGM.SelectedCells.First().Item.GetType().GetProperty(DGM.SelectedCells.FirstOrDefault().Column.Header.ToString()).GetValue(DGM.SelectedCells.First().Item).ToString(), out d))
                        {
                            GRPBElm.Content  = "1";
                            GRPBSum.Content  = d.ToString("N2", CultureInfo.CreateSpecificCulture("ru-RU"));
                            GRPBSred.Content = "";
                            GRPBMin.Content  = "";
                            GRPBMax.Content  = "";
                        }
                    }
                    else
                    {
                        double sum     = 0;
                        int    counter = 0;
                        double min     = double.MaxValue;
                        double max     = 0;
                        foreach (var item in DGM.SelectedCells)
                        {
                            double d;
                            if (double.TryParse(item.Item.GetType().GetProperty(item.Column.Header.ToString()).GetValue(item.Item).ToString(), out d))
                            {
                                if (d > max)
                                {
                                    max = d;
                                }
                                if (d < min)
                                {
                                    min = d;
                                }
                                counter++;
                                sum += d;
                            }
                        }
                        GRPBElm.Content  = counter.ToString("N0", CultureInfo.CreateSpecificCulture("ru-RU"));
                        GRPBSum.Content  = sum.ToString("N2", CultureInfo.CreateSpecificCulture("ru-RU"));
                        GRPBSred.Content = (sum == 0 ? 0 : sum / counter).ToString("N2", CultureInfo.CreateSpecificCulture("ru-RU"));
                        GRPBMin.Content  = min.ToString("N2", CultureInfo.CreateSpecificCulture("ru-RU"));
                        GRPBMax.Content  = max.ToString("N2", CultureInfo.CreateSpecificCulture("ru-RU"));
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #60
0
 public AdapterPipelineItem(Foundation foundation, IServiceLocatorAdapter serviceLocator,
                            IServiceLocatorStore store, PostResolutionPipeline pipeline)
     : base(foundation, serviceLocator, store)
 {
     this.pipeline = pipeline;
 }