Inheritance: System.Web.UI.Page
		public override void onListItemClick(ListView l, View v, int position, long id)
		{
			string path = mCurrentPath + mArrayList[position];
			File file = new File(path);

			if (file.Directory)
			{
				if (path.IndexOf(PARENT_DIRECTORY_PATH, StringComparison.Ordinal) > 0)
				{
					mCurrentPath = file.ParentFile.Parent + DIRECTORY_DELIMITER;
				}
				else
				{
					mCurrentPath = path;
				}
				createDirectoryList(new File(mCurrentPath));

				mTextView.Text = mCurrentPath;
				mAdapter.notifyDataSetChanged();
			}
			else
			{
				if (!path.EndsWith(".fls", StringComparison.Ordinal) && !path.EndsWith(".bin", StringComparison.Ordinal))
				{
					Toast.makeText(this, "Must choose .fls or .bin file", Toast.LENGTH_SHORT).show();
				}
				else
				{
					Intent data = new Intent();
					data.putExtra(MainActivity.FIRMWARE_FILE_NAME, path);
					setResult(MainActivity.RESULT_CODE_SELECT_FIRMWARE, data);
					finish();
				}
			}
		}
        /// <summary>
        /// Create a new dimension element using the given
        /// references and dimension line end points.
        /// This method opens and commits its own transaction,
        /// assuming that no transaction is open yet and manual
        /// transaction mode is being used.
        /// Note that this has only been tested so far using
        /// references to surfaces on planar walls in a plan
        /// view.
        /// </summary>
        public static void CreateDimensionElement(
            View view,
            XYZ p1,
            Reference r1,
            XYZ p2,
            Reference r2)
        {
            Document doc = view.Document;

              ReferenceArray ra = new ReferenceArray();

              ra.Append( r1 );
              ra.Append( r2 );

              Line line = Line.CreateBound( p1, p2 );

              using( Transaction t = new Transaction( doc ) )
              {
            t.Start( "Create New Dimension" );

            Dimension dim = doc.Create.NewDimension(
              view, line, ra );

            t.Commit();
              }
        }
Beispiel #3
0
		public Controller(View view)
		{
			this.view = view;
			DomEvent.AddHandler(view.uiEventDisplayDiv, "mousedown", OnMouseDown);
			DomEvent.AddHandler(view.uiEventDisplayDiv, "keydown", OnKeyDown);
			this.emptyHtml = view.uiEventDisplayDiv.InnerHTML;
		}
Beispiel #4
0
 /// <summary>
 /// Constructor, creates new instances of necessary objects
 /// save them to fields 
 /// </summary>
 /// <param name="mainMenu"></param>
 /// <param name="editUpdateMenu"></param>
 public MemberController(View.MainMenuView mainMenu, EditUpdateMenu editUpdateMenu)
 {
     _mainMenu = mainMenu;
     _editUpdateMenu = editUpdateMenu;
     _memberDAL = new MemberDAL(directorieStrs.MemberListPath);
     _members = new List<Member>();
 }
Beispiel #5
0
 public static void CreateWizardView(this ActionBaseEventArgs e, IObjectSpace objectSpace, object newObject, View sourceView){
     e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
     e.ShowViewParameters.Context = "WizardDetailViewForm";
     if (e.ShowViewParameters.CreatedView == null){
         e.ShowViewParameters.CreatedView = e.Action.Application.CreateDetailView(objectSpace, newObject, sourceView);
     }
 }
Beispiel #6
0
 void ToggleViewOnSelection(View myView)
 {
     if (selectedView != myView) { selectedView = myView; }
     if (lastView != null) { Managers.Views.ToggleView(lastView, false); }
     Managers.Views.ToggleView(selectedView, true);
     lastView = selectedView;
 }
Beispiel #7
0
        public override Figure GetScene(Figure Foreground, Camera Camera, View View)
        {
            double zoom = Camera.Zoom;

            double wash = Math.Min(1.0, Math.Max(0.0, (zoom + 2.0) / 10.0));
            Color topcol = Color.Mix(Color.RGB(0.3, 0.6, 0.7), Color.RGB(0.3, 0.5, 0.8), wash);
            Color botcol = Color.Mix(Color.RGB(0.1, 0.4, 0.6), Color.RGB(0.1, 0.3, 0.7), wash);
            Figure fig = MeshFigure.CreateQuad(
                new MeshVertex(View.TopLeft, topcol),
                new MeshVertex(View.TopRight, topcol),
                new MeshVertex(View.BottomLeft, botcol),
                new MeshVertex(View.BottomRight, botcol));

            foreach (Layer l in this._Layers)
            {
                double pg = (zoom - l.MinZoom) / (l.MaxZoom - l.MinZoom);
                if (pg > 0.0 && pg < 1.0)
                {
                    double op = pg * (1.0 - pg) * 4.0;
                    fig += new ModulatedFigure(Color.RGBA(1.0, 1.0, 1.0, op), l.Figure);
                }
            }
            fig += Foreground;
            return fig;
        }
 public Printer(View.UserInput input)
     : this()
 {
     // Always a dilemma how much validation to do and where
     // For now expecting View to validate user input
     // TODO: Clear definition of protocol for each of M, V and C
     //       so it is clear what validation to do and where.
     if (input.Options["feedType"] != null)
     {
         feedType = input.Options["feedType"];
     }
     if (input.Options["feedIdentifier"] != null)
     {
         feedIdentifier = input.Options["feedIdentifier"];
     }
     if (input.Options["/with"] != null) {
         conditions["searchTerm"] = input.Options["/with"];
         conditions["excludeSearchTerm"] = false;
     }
     else if (input.Options["/without"] != null) {
         conditions["searchTerm"] = input.Options["/with"];
         conditions["excludeSearchTerm"] = true;
     }
     if (input.Options["/latest"] != null) {
         conditions["tailSize"] = input.Options["/latest"];
     }
 }
 public TimeLineViewHolder(View itemView, int viewType)
     : base(itemView)
 {
     name = itemView.FindViewById<TextView>(Resource.Id.tx_name);
     mTimelineView = itemView.FindViewById<TimelineView>(Resource.Id.time_marker);
     mTimelineView.InitLine(viewType);
 }
 /// <summary>
 /// Default constructor for the class
 /// </summary>
 public DataTablePropertiesDialog(MainForm frm, Project currentProject, View view)
     : base(frm)
 {
     InitializeComponent();
     project = currentProject;
     currentView = view;
 }
 public CharacterSelectController(View controlledView)
     : base(controlledView)
 {
     CharacterList = new List<CharacterListItem>();
     OperationHandlers.Add((byte)MessageSubCode.ListCharacters, new CharacterListHandler(this));
     OperationHandlers.Add((byte) MessageSubCode.SelectCharacter, new SelectCharacterHandler(this));
 }
        public void Export(JekyllExporter exporter, View view, StreamWriter writer)
        {
            var guid = Guid.NewGuid();

            writer.WriteLine($"<div id='{guid}' class='cy'></div>");
            writer.WriteLine(@"
            <script>
            var cy = cytoscape({
            ");
            writer.WriteLine($"container: document.getElementById('{guid}'),");
            writer.WriteLine("elements: [");

            var nodes = view.Elements.Select(e => "{ data: { id: '" + e.Name + "', width: '"+ e.Name.Length * 10 +"px' } }");
            var edges = view.Relationships.Select(r => "{ data: { id: '" + r.Source.Name + "_to_" + r.Target.Name + "', source: '"+ r.Source.Name +"', target: '"+r.Target.Name+"' } }");

            writer.WriteLine(string.Join(",", nodes.Union(edges)));

            writer.WriteLine(@"
              ],

              style: cyto_" + view.ViewType.ToString().ToLowerInvariant() + @",

              layout: {
            name: 'cola',
            fit: true,
            nodeSpacing: 5,
            edgeLengthVal: 45
              }

            });
            </script>");
        }
        //Constructor
        public MemberRegistry(View.Console a_view)
        {
            m_isInStartup = true;
            m_view = a_view;

            //try to load member list from storage
            m_memberListDAL = new Model.MemberListDAL();
            m_memberList = m_memberListDAL.LoadMemberList();
            if (m_memberList == null)
            {
                m_memberList = new Model.MemberList();
            }

            //subscribe to the MemberList
            m_memberList.AddSubscriber(this);

            //try to load user list from storage
            m_userListDAL = new Model.UserListDAL();
            m_userList = m_userListDAL.LoadUserList();
            if (m_userList == null)
            {
                m_userList = new Model.UserList();
            }

            //subscribe to the UserList
            m_userList.AddSubscriber(this);

            m_addingEditingMember = null;
            m_loggedInUser = null;
            m_memberFiltering = null;

            m_isInStartup = false;
        }
Beispiel #14
0
 protected override void UpdateEffect(GameTime gameTime, View view)
 {
     if (Acceleration != Vector2.Zero) {
         Velocity = Vector2.Add (Velocity, Acceleration);
     }
     view.PositionAdd(Velocity);
 }
    protected void btnUserButton_Click(object sender, EventArgs e)
    {
        try
        {
            int numOfViews = Convert.ToInt32(txtUserTextbox.Text); // Get number of views from textbox
            views.Clear();
            for (int i = 0; i < numOfViews; i++)
            {
                // Create view
                Label lblOne = new Label();
                lblOne.Text = "View " + (i+1).ToString();
                View myViewOne = new View();
                myViewOne.Controls.Add(lblOne);
                // Build view list
                views.Add(myViewOne);
                mvUserMultiview.Views.Add(myViewOne);
                // Build navigation list
                ddNavigation.Items.Add("View " + (i+1));
            }

            ddNavigation.Visible = true; // Unhide dropdown
            mvUserMultiview.ActiveViewIndex = 0; // Set multiview focus to first view
        }
        catch
        {

        }
    }
        public frmMain()
        {
            InitializeComponent();

            viewCurent = View.Main;

            clhData.Width = -1;
            clhDetalii.Width = 350;
            clhPerioada.Width =-1;
            clhSuma.Width = -2;

            pnlAdaugaNotita.Hide();
            pnlNotite.Hide();
            pnlGrafic.Hide();
            pnlAdaugaEveniment.Hide();
            pnlMain.Show();

            evenimente = EvenimentReader.citesteEvenimente("evenimente.xml");
            maxIdEveniment = getMaxIdEveniment();

            notite = NotitaReader.citesteNotite("notite.xml");
            maxIdNotita = getMaxIdNotita();

            amModificat = false;
            modificare = false;
            totalEvenimente = true;
            amAfisatEvenimentePeriodice = false;

            afiseazaEvenimente();

            tmrEvenimente.Enabled = true;
        }
Beispiel #17
0
        public void HandleEventNewMember(View.Console view, Model.MemberRegister register)
        {
            view.ShowInputInfo(View.Console.MenuEvent.AddNewMember, null);

            Model.Member m = new Model.Member(register.GetNextMemberId());

            try
            {
                m.Name = view.InputMemberName();
            }
            catch (ArgumentException)
            {
                view.ShowErrorMessage(View.Console.Error.InvalidMemberName, null);
                view.Wait();
                return;
            }
            try { m.PersonalNumber = view.InputMemberPersonalNumber(); }
            catch (ArgumentException)
            {
                view.ShowErrorMessage(View.Console.Error.InvalidPersonalNumber, null);
                view.Wait();
                return;
            }

            register.AddMember(m);
            register.Save();
        }
 public void OnClick(View v)
 {
     var offset = _scrollView.ParallaxOffset;
     switch (v.Id)
     {
         case Resource.Id.minus:
             offset = _scrollView.ParallaxOffset;
             offset = offset - 0.05f;
             _scrollView.ParallaxOffset = offset;
             offset = _scrollView.ParallaxOffset;
             _factorText.Text = string.Format("{0}", offset);
             break;
         case Resource.Id.plus:
             offset = _scrollView.ParallaxOffset;
             offset = offset + 0.05f;
             _scrollView.ParallaxOffset = offset;
             offset = _scrollView.ParallaxOffset;
             _factorText.Text = string.Format("{0}", offset);
             break;
     }
     if (offset * 100 <= 10)
     {
         _minus.Enabled = false;
         _plus.Enabled = true;
     }
     else
     {
         _minus.Enabled = true;
         _plus.Enabled = true;
     }
 }
Beispiel #19
0
        // -------------------------------------------------
        public Form_InfinitiveLoop ()
        {
            InitializeComponent ();
            mover = new Mover (this);
            //Font = new Font ("Times New Roman", 14);

            sizefStrs = Auxi_Geometry .MeasureStrings (this, strs);
            hStr = Convert .ToInt32 (sizefStrs [0] .Height);
            Prepare_lrsView ();

            text = new TextMR (this, new Point (450, 100), "Figure - moved by strips, reconfigured by circles\r\n" +
                                                           "Group and text - moved by any inner point");

            ptPolygonCenter = NewPolygonCenter;
            view = View .ReverseCover;
            comboView .SelectedIndex = Convert .ToInt32 (view);

            rand = Auxi_Common .RandomByCurTime (out nSeed);
            numericUD_Points .Value = (numericUD_Points .Minimum + numericUD_Points .Maximum) / 2;
            numericUD_Radius .Value = 15;
            numericUD_HalfStrip .Value = 5;
            int nPoints = Convert .ToInt32 (numericUD_Points .Value);
            Point [] pts = new Point [nPoints];
            for (int i = 0; i < pts .Length; i++)
            {
                pts [i] = new Point (notCloser + rand .Next (nSeed) % (ClientSize .Width - 2 * notCloser),
                                     notCloser + rand .Next (nSeed) % (ClientSize .Height - 2 * notCloser));
            }
            loop = new InfinitiveLoop (pts, Convert .ToInt32 (numericUD_Radius .Value),
                                            Convert .ToInt32 (numericUD_HalfStrip .Value), Color .Blue, Color .Yellow);
            RenewMover ();

            bAfterInit = true;
        }
Beispiel #20
0
        public void Show(View view, object param = null)
        {
            Window newWindow;

            switch (view)
            {
                case View.Main:
                    newWindow = new MainWindowView();
                    break;

                case View.Results:
                    newWindow = new ResultsWindowView();
                    Messenger.Default.Send(new SearchParamsMessage((string)param));
                    break;

                case View.CountriesList:
                    newWindow = new CountriesListWindowView();
                    break;

                case View.CountryDetails:
                    newWindow = new CountryDetailsWindowView();
                    Messenger.Default.Send(new CountryToShowDetailsMessage((string)param));
                    break;

                case View.Help:
                    newWindow = new HelpWindowView();
                    break;

                default:
                    return;
            }

            newWindow.ShowDialog();
        }
 protected View GetView(string vn)
 {
     View v = new View();
     switch (vn)
     {
         case "Reports":
             return report_snapshot;
         case "My Services":
             return services_snapshot;
         case "Employees":
             return employee_snapshot;
         case "Business Overview":
             return business_snapshot;
         case "Customers":
             return customer_snapshot;
         case "Recent Activity":
             return recent_snapshot;
         case "Accounting Activity":
             return accounting_snapshot;
         case "PSI Support Tickets":
             return psi_support_tickets;
         case "PSI Overview":
             return psi_overview;
         case "PSI Support Follow Up":
             return psi_support_followup;
         case "Overview":
             return overview;
         case "Sales Overview":
             return sales_overview;
         case "Customer Dashboard":
             return customer;
         default:
             return services_snapshot;
     }
 }
Beispiel #22
0
 public SPOViewPipeBind()
 {
     _viewEntity = null;
     _view = null;
     _id = Guid.Empty;
     _name = string.Empty;
 }
        public void Export(View view)
        {
            var path = _configuration.Path(view);

            Directory.CreateDirectory(Path.GetDirectoryName(path));

            using (var stream = new FileStream(path, FileMode.Create))
            using (var writer = new StreamWriter(stream))
            {
                writer.WriteLine("---");
                writer.WriteLine("layout: page");
                writer.WriteLine($"title: {view.Name}");
                writer.WriteLine($"permalink: {_configuration.Permalink(view)}");
                writer.WriteLine($"type: {view.ViewType.ToString().ToLowerInvariant()}");
                writer.WriteLine($"tags: [view, {view.Name}]");
                writer.WriteLine("---");
                // export the image

                writer
                    .AppendViewBlock(this, view, new XGraphVizExporter.XGraphVizExporter())
                    .EmptyLine()
                    .AppendViewBlock(this, view, new ElementListViewExporter());

                writer.Flush();
            }
        }
Beispiel #24
0
 public void Show(View view, object param = null)
 {
     Messenger.Default.Send(
         param == null
             ? new Uri(_viewToUri[view], UriKind.Relative)
             : new Uri(String.Format(_viewToUri[view], param), UriKind.Relative), "NavigationRequest");
 }
Beispiel #25
0
        public void Init()
        {
            var spawns = Entity.GetByClass<SpawnPoint>();
            if(spawns.Count() > 0)
            {
                Position = spawns.First().Position;
                Rotation = spawns.First().Rotation;
            }

            View = View.Get(Id);

            View.Position = Position;
            View.Rotation = Rotation;
            View.FieldOfView = Math.DegreesToRadians(60);

            ReceiveUpdates = true;

            // Defined in Libs/Config/defaultprofile.xml
            Input.RegisterAction("zoom_in", OnActionZoomIn);
            Input.RegisterAction("zoom_out", OnActionZoomOut);

            Input.MouseEvents += ProcessMouseEvents;

            MaxZoomLevel = 5;
            MaxDistanceFromTarget = 100;

            CurrentZoomLevel = MaxZoomLevel;

            // The CVar attribute isn't functional at the moment, so we use this workaround.
            CVar.RegisterInt("g_camMaxZoomLevel", ref MaxZoomLevel);
            CVar.RegisterFloat("g_camMaxDistanceFromTarget", ref MaxDistanceFromTarget);

            TargetEntity = Launcher.Instance;
        }
Beispiel #26
0
 public virtual IEnumerable<ILogicRuleObject> GetValidRules(View view,  ExecutionContext executionContext) {
     if (view!=null) {
         var tuple = new Tuple<ITypeInfo, ExecutionContext>(view.ObjectTypeInfo, executionContext);
         return LogicRuleManager.Instance[tuple].Where(rule => IsValidRule(rule, view)).OrderBy(rule => rule.Index);
     }
     return Enumerable.Empty<ILogicRuleObject>();
 }
			public override View getView(int position, View convertView, ViewGroup parent)
			{
				LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
				View rowView = inflater.inflate(mResource, parent, false);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.opentok.android.Subscriber subscriber = mSubscribers.get(position);
				Subscriber subscriber = outerInstance.mSubscribers[position];

				// Set name
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.widget.TextView name = (android.widget.TextView) rowView.findViewById(R.id.subscribername);
				TextView name = (TextView) rowView.findViewById(R.id.subscribername);
				name.Text = subscriber.Stream.Name;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.widget.ImageView picture = (android.widget.ImageView) rowView.findViewById(R.id.subscriberpicture);
				ImageView picture = (ImageView) rowView.findViewById(R.id.subscriberpicture);

				// Initialize meter view
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final com.opentok.android.demo.ui.MeterView meterView = (com.opentok.android.demo.ui.MeterView) rowView.findViewById(R.id.volume);
				MeterView meterView = (MeterView) rowView.findViewById(R.id.volume);
				meterView.setIcons(BitmapFactory.decodeResource(Resources, R.drawable.unmute_sub), BitmapFactory.decodeResource(Resources, R.drawable.mute_sub));
				subscriber.AudioLevelListener = new AudioLevelListenerAnonymousInnerClassHelper(this, subscriber, meterView);

				meterView.setOnClickListener(new OnClickListenerAnonymousInnerClassHelper(this, subscriber, name, picture));

				return rowView;
			}
		public override void onClick(View view)
		{
			switch (view.Id)
			{
				case R.id.translate_button:
				{
					cancelAsyncTransaction();
					// translate all points coordinates using an async transaction
//JAVA TO C# CONVERTER TODO TASK: The following anonymous inner class could not be converted:
//					asyncTransaction = realm.executeTransaction(new io.realm.Realm.Transaction()
	//				{
	//					@@Override public void execute(Realm realm)
	//					{
	//						// query for all points
	//						RealmResults<Dot> dots = realm.@where(Dot.class).findAll();
	//
	//						for (int i = dots.size() - 1; i >= 0; i--)
	//						{
	//							Dot dot = dots.get(i);
	//							if (dot.isValid())
	//							{
	//								int x = dot.getX();
	//								int y = dot.getY();
	//								dot.setX(y);
	//								dot.setY(x);
	//							}
	//						}
	//					}
	//				}
				   , new CallbackAnonymousInnerClassHelper(this)
				   );
					break;
				}
			}
		}
Beispiel #29
0
        protected override string GenerateHtml(View view, string className, string clasError)
        {
            string s = "<input type=\"password\" value=\"" + HttpUtility.HtmlAttributeEncode(Value) + "\"";

            s = AddIdAttribute(s);
            s = AddNameAttribute(s);
            s = AddClassAttribute(s, className, clasError);
            s = AddEnabledAttribute(s);
            s = AddOnChangeAttribute(s);

            if (MaxLength != Int32.MaxValue)
                s += " maxlength=\"" + MaxLength + "\"";

            if (Size != 0)
                s += " size=\"" + Size + "\"";

            if (!string.IsNullOrEmpty(OnKeyDown))
                s += " onkeydown=\"" + OnKeyDown + "\"";

            if (!string.IsNullOrEmpty(OnKeyUp))
                s += " onkeyup=\"" + OnKeyUp + "\"";

            if (!string.IsNullOrEmpty(OnKeyPress))
                s += " onkeypress=\"" + OnKeyPress + "\"";

            s += " autocomplete=\"off\"";

            return s + " />";
        }
        public override void PortRegistered(View.VPort port)
        {
            logger.Log("{0} got registeration notification for {1}", ToString(), port.ToString());

            lock (this)
            {
                if (Role.ContainsRole(port, RoleFitbitUltra.RoleName))
                {
                    fitbitPort = port;
                    logger.Log("{0} added fitbitUltra port {1}", this.ToString(), port.ToString());

                    if (logWindow != null)
                        logWindow.Invoke(new Action(delegate() { logWindow.ConsoleLog("added port " + port.ToString()); }));
                }

                if (Role.ContainsRole(port, RoleSensor.RoleName))
                {
                    sensorPort = port;
                    logger.Log("{0} added switchbinary port {0}", this.ToString(), port.ToString());

                    if (logWindow != null)
                        logWindow.Invoke(new Action(delegate() { logWindow.ConsoleLog("added port " + port.ToString()); }));
                }
            }
        }
Beispiel #31
0
        //-----------------------------------------------------------------------------

        //------------------Implementation of Mouse Events sink method------------------
        //------------------------------------------------------------------------------
        public void MouseEvents_OnMouseMove(MouseButtonEnum Button, ShiftStateEnum ShiftKeys, Point ModelPosition, Point2d ViewPosition, View View)
        {
            m_parentCmd.OnMouseMove(Button, ShiftKeys, ModelPosition, ViewPosition, View);
        }
Beispiel #32
0
 //-----------------------------------------------------------------------------
 public void SelectEvents_OnUnSelect(ObjectsEnumerator unSelectedEntities, SelectionDeviceEnum selectionDevice, Point modelPosition, Point2d viewPosition, View view)
 {
     m_parentCmd.OnUnSelect(unSelectedEntities, selectionDevice, modelPosition, viewPosition, view);
 }
 //Deposit
 public override void OnLeftLowButtonClicked()
 {
     View.SetPresenter(new DepositMainFormPresenter(AtmManger, Session, View));
 }
Beispiel #34
0
 //-----------------------------------------------------------------------------
 public void SelectEvents_OnPreSelect(ref object preSelectEntity, out bool doHighlight, ref ObjectCollection morePreSelectEntities, SelectionDeviceEnum selectionDevice, Point modelPosition, Point2d viewPosition, View view)
 {
     m_parentCmd.OnPreSelect(preSelectEntity, out doHighlight, morePreSelectEntities, selectionDevice, modelPosition, viewPosition, view);
 }
Beispiel #35
0
        //------------------------------------------------------------------------------


        //------------------Implementation of Select Events sink method-----------------
        //------------------------------------------------------------------------------
        public void SelectEvents_OnSelect(ObjectsEnumerator justSelectedEntities, SelectionDeviceEnum selectionDevice, Point modelPosition, Point2d viewPosition, View view)
        {
            //not implemented
            m_parentCmd.OnSelect(justSelectedEntities, selectionDevice, modelPosition, viewPosition, view);
        }
 public override View GetView(int position, View convertView, ViewGroup parent)
 {
     return convertView ?? SetPlayerView(position);
 }
 //Balance
 public override void OnRightHighButtonClicked()
 {
     View.SetPresenter(new ShowBalanceMainFormPresenter(AtmManger, Session, View));
 }
 //Return
 public override void OnRightLowButtonClicked()
 {
     View.SetPresenter(new StarterMainFormPresenter(AtmManger, View));
 }
Beispiel #39
0
        public void PreferenceSetting()
        {
            // Test Case to ensure that the link for these persistent variable
            // between DynamoViewModel, Model is not broken or replaced.
            #region FullscreenWatchShowing
            bool expectedValue = !ViewModel.Model.PreferenceSettings.FullscreenWatchShowing;
            ViewModel.ToggleFullscreenWatchShowing(null);
            Assert.AreEqual(expectedValue, ViewModel.Model.PreferenceSettings.FullscreenWatchShowing);

            expectedValue = !ViewModel.Model.PreferenceSettings.FullscreenWatchShowing;
            ViewModel.ToggleFullscreenWatchShowing(null);
            Assert.AreEqual(expectedValue, ViewModel.Model.PreferenceSettings.FullscreenWatchShowing);
            #endregion

            #region ConsoleHeight
            int expectedHeight = 100;;
            ViewModel.ToggleConsoleShowing(null);
            Assert.AreEqual(expectedHeight, ViewModel.Model.PreferenceSettings.ConsoleHeight);

            expectedHeight = 0;
            ViewModel.ToggleConsoleShowing(null);
            Assert.AreEqual(expectedHeight, ViewModel.Model.PreferenceSettings.ConsoleHeight);
            #endregion

            #region ConnectorType
            ConnectorType expectedConnector = ConnectorType.BEZIER;
            ViewModel.SetConnectorType("BEZIER");
            Assert.AreEqual(expectedConnector, ViewModel.Model.PreferenceSettings.ConnectorType);

            expectedConnector = ConnectorType.POLYLINE;
            ViewModel.SetConnectorType("POLYLINE");
            Assert.AreEqual(expectedConnector, ViewModel.Model.PreferenceSettings.ConnectorType);
            #endregion

            #region Collect Information Option
            {
                // Backup the value of Dynamo.IsTestMode and restore it later. The
                // reason for this is 'IsUsageReportingApproved' only returns the
                // actual value when not running in test mode.
                var isTestMode = DynamoModel.IsTestMode;

                // First time run, check if dynamo did set it back to false after running
                Assert.AreEqual(false, UsageReportingManager.Instance.FirstRun);

                // CollectionInfoOption To TRUE
                UsageReportingManager.Instance.SetUsageReportingAgreement(true);
                RestartTestSetup(startInTestMode: false);
                Assert.AreEqual(true, UsageReportingManager.Instance.IsUsageReportingApproved);

                // CollectionInfoOption To FALSE
                UsageReportingManager.Instance.SetUsageReportingAgreement(false);
                RestartTestSetup(startInTestMode: false);
                Assert.AreEqual(false, UsageReportingManager.Instance.IsUsageReportingApproved);

                DynamoModel.IsTestMode = isTestMode; // Restore the orignal value.
            }
            #endregion

            #region Save And Load of PreferenceSettings
            // Test if variable can be serialize and deserialize without any issue
            string tempPath = System.IO.Path.GetTempPath();
            tempPath = Path.Combine(tempPath, "userPreference.xml");

            // Force inital state
            PreferenceSettings initalSetting = new PreferenceSettings();
            PreferenceSettings resultSetting;

            #region First Test

            initalSetting.ConnectorType          = ConnectorType.BEZIER;
            initalSetting.ConsoleHeight          = 100;
            initalSetting.FullscreenWatchShowing = true;

            initalSetting.Save(tempPath);
            resultSetting = PreferenceSettings.Load(tempPath);

            Assert.AreEqual(resultSetting.FullscreenWatchShowing, initalSetting.FullscreenWatchShowing);
            Assert.AreEqual(resultSetting.ConnectorType, initalSetting.ConnectorType);
            Assert.AreEqual(resultSetting.ConsoleHeight, initalSetting.ConsoleHeight);
            #endregion

            #region Second Test
            initalSetting.ConnectorType          = ConnectorType.POLYLINE;
            initalSetting.ConsoleHeight          = 0;
            initalSetting.FullscreenWatchShowing = false;

            initalSetting.Save(tempPath);
            resultSetting = PreferenceSettings.Load(tempPath);

            Assert.AreEqual(resultSetting.FullscreenWatchShowing, initalSetting.FullscreenWatchShowing);
            Assert.AreEqual(resultSetting.ConnectorType, initalSetting.ConnectorType);
            Assert.AreEqual(resultSetting.ConsoleHeight, initalSetting.ConsoleHeight);
            #endregion

            #endregion

            View.Close();
        }
 //Withdraw
 public override void OnLeftHighButtonClicked()
 {
     View.SetPresenter(new WithdrawMainFormPresenter(AtmManger, Session, View));
 }
Beispiel #41
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var  taak = taken[position];
            View view = convertView;

            if (view == null)
            {
                view = context.LayoutInflater.Inflate(Resource.Layout.ListRow, parent, false);
            }

            TextView description = view.FindViewById <TextView>(Resource.Id.TextLeftBig);

            description.Text = $"{taak.stap} - {taak.omschrijving}";
            TextView completion = view.FindViewById <TextView>(Resource.Id.TextRightBig);

            completion.TextSize = 30;

            switch (taak.voltooid)
            {
            case "0":
                completion.Text = "O";
                completion.SetTextColor(Color.ParseColor("#3D3D3D"));
                description.SetTextColor(Color.ParseColor("#3D3D3D"));
                break;

            case "1":
                completion.Text = "V";
                completion.SetTextColor(Color.ParseColor("#00a000"));
                description.SetTextColor(Color.ParseColor("#00a000"));
                break;
            }

            view.FindViewById <TextView>(Resource.Id.TextLeftSmall).Visibility  = ViewStates.Gone;
            view.FindViewById <TextView>(Resource.Id.TextRightSmall).Visibility = ViewStates.Gone;

            LinearLayout row = view.FindViewById <LinearLayout>(Resource.Id.ListViewRow);

            row.Click += (object sender, EventArgs e) =>
            {
                if (Global.zorgmoment.aanwezigheid_begin != "" && Global.zorgmoment.aanwezigheid_eind == "")
                {
                    DatabaseTaak dbt = new DatabaseTaak(context);
                    switch (completion.Text)
                    {
                    case "V":
                        completion.Text = "O";
                        completion.SetTextColor(Color.ParseColor("#3D3D3D"));
                        description.SetTextColor(Color.ParseColor("#3D3D3D"));
                        dbt.UpdateTaak(taak.id, "0");
                        break;

                    case "O":
                        completion.Text = "V";
                        completion.SetTextColor(Color.ParseColor("#00a000"));
                        description.SetTextColor(Color.ParseColor("#00a000"));
                        dbt.UpdateTaak(taak.id, "1");
                        break;
                    }
                }
                else
                {
                    new AlertDialog.Builder(context)
                    .SetTitle("Aanwezigheid vereist")
                    .SetMessage("U dient aanwezig gemeld te zijn bij deze cliënt om taken te kunnen afvinken.")
                    .Show();
                }
            };

            return(view);
        }
 protected virtual void AttachNavigationController()
 {
     AddChildViewController(NavigationController);
     View.AddSubview(NavigationController.View);
 }
Beispiel #43
0
 public MyHolderBlocked(View view)
 {
     this.BlockedName = view.FindViewById <TextView>(Resource.Id.blocked);
 }
Beispiel #44
0
 public void Save()
 {
     Model.Set(View.BanggiaItems);
     View.RefreshData();
 }
Beispiel #45
0
        // This is a sample method that handles the FinishedPickingMediaEvent
        protected void Handle_FinishedPickingMedia(object sender, UIImagePickerMediaPickedEventArgs e)
        {
            // determine what was selected, video or image
            bool isImage = false;

            switch (e.Info[UIImagePickerController.MediaType].ToString())
            {
            case "public.image":
                Console.WriteLine("Image selected");
                isImage = true;
                break;

            case "public.video":
                Console.WriteLine("Video selected");
                break;
            }

            Console.Write("Reference URL: [" + UIImagePickerController.ReferenceUrl + "]");

            // get common info (shared between images and video)
            NSUrl referenceURL = e.Info[new NSString("UIImagePickerControllerReferenceUrl")] as NSUrl;

            if (referenceURL != null)
            {
                Console.WriteLine(referenceURL.ToString());
            }

            // if it was an image, get the other image info
            if (isImage)
            {
                // get the original image
                UIImage originalImage = e.Info[UIImagePickerController.OriginalImage] as UIImage;
                if (originalImage != null)
                {
                    // do something with the image
                    Console.WriteLine("got the original image");
                    imageView.Image = originalImage;
                }

                // get the edited image
                UIImage editedImage = e.Info[UIImagePickerController.EditedImage] as UIImage;
                if (editedImage != null)
                {
                    // do something with the image
                    Console.WriteLine("got the edited image");
                    imageView.Image = editedImage;
                }

                //- get the image metadata
                NSDictionary imageMetadata = e.Info[UIImagePickerController.MediaMetadata] as NSDictionary;
                if (imageMetadata != null)
                {
                    // do something with the metadata
                    Console.WriteLine("got image metadata");
                }
            }
            // if it's a video
            else
            {
                // get video url
                NSUrl mediaURL = e.Info[UIImagePickerController.MediaURL] as NSUrl;
                if (mediaURL != null)
                {
                    //
                    Console.WriteLine(mediaURL.ToString());
                }
            }

            // dismiss the picker
            imagePicker.DismissModalViewController(true);
            UITextView lblScore = new UITextView();

            lblScore.Frame           = new CoreGraphics.CGRect(1, 500, 370, 70);
            lblScore.BackgroundColor = UIColor.FromRGB(246, 246, 246);
            lblScore.TextAlignment   = UITextAlignment.Center;
            UIImage imagenT      = imageView.Image;
            NSData  imageData    = imagenT.AsPNG();
            var     btnFavorite2 = new UIButton(UIButtonType.Custom);

            btnFavorite2.Frame = new CoreGraphics.CGRect(10, 400, 40, 40);
            string image = "twitter.png";

            byte[] myArr = new Byte[imageData.Length];
            System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, myArr, 0, Convert.ToInt32(imageData.Length));
            MSCognitiveService cognser           = new MSCognitiveService();
            string             descripcionImagen = cognser.PeticionImagenDescripcion(myArr);

            lblScore.Text = descripcionImagen;
            View.Add(lblScore);
            btnFavorite2.SetImage(UIImage.FromBundle(image), UIControlState.Normal);
            btnFavorite2.TouchUpInside += delegate
            {
                try
                {
                    TWPublicarTweet twtwit  = new TWPublicarTweet();
                    string          MediaId = twtwit.ObtenerIdImagen(myArr);
                    if (!twtwit.PeticionPublicarTweet("Proyecto PDMII ISSC,MSCognitiveService.Descripción obtenida: " + descripcionImagen, MediaId))
                    {
                        new UIAlertView("ERROR", "no se compartio", null, "ok", null).Show();
                    }
                }
                catch (Exception ex)
                {
                    new UIAlertView("ERROR", ex.Message, null, "ok", null).Show();
                }
            };
            View.Add(btnFavorite2);
        }
Beispiel #46
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            context = Application.Context;
            var view = convertView ?? activitys.LayoutInflater.Inflate(Resource.Layout._modelTheBestHeliListViewml, parent, false);


            ImageView img = view.FindViewById<ImageView>(Resource.Id.imglistviewmodelH);
            txtName = view.FindViewById<TextView>(Resource.Id.textTheBestHeliName);
            txtMaxSpeed = view.FindViewById<TextView>(Resource.Id.textTheBestHeliMaxSpeed);
            txtClimbTo1000 = view.FindViewById<TextView>(Resource.Id.textTheBestHeliClimbTo1000);
            ImageView flag = view.FindViewById<ImageView>(Resource.Id.theBestFlagH);
            txtThrustToWeightRatio = view.FindViewById<TextView>(Resource.Id.textTheBestHeliThrustToWeightRatio);
            txtAGMCount = view.FindViewById<TextView>(Resource.Id.textTheBestHeliAGMCount);
            txtAGMArmorPenetration = view.FindViewById<TextView>(Resource.Id.textTheBestHeliAGMArmorPenetration);
            txtAGMRange = view.FindViewById<TextView>(Resource.Id.textTheBestHeliAGMRange);
            txtASMCount = view.FindViewById<TextView>(Resource.Id.textTheBestHeliASMCount);


            theBestIco1 = view.FindViewById<ImageView>(Resource.Id.theBestHeliIco1);
            theBestIco2 = view.FindViewById<ImageView>(Resource.Id.theBestHeliIco2);
            theBestIco3 = view.FindViewById<ImageView>(Resource.Id.theBestHeliIco3);
            theBestIco4 = view.FindViewById<ImageView>(Resource.Id.theBestHeliIco4);
            theBestIco5 = view.FindViewById<ImageView>(Resource.Id.theBestHeliIco5);
            theBestIco6 = view.FindViewById<ImageView>(Resource.Id.theBestHeliIco6);
            theBestIco7 = view.FindViewById<ImageView>(Resource.Id.theBestHeliIco7);

            img.SetImageResource(helis[position].Image);
            flag.SetImageResource(helis[position].FlagImageTheBest);
            txtName.Text = helis[position].Name;
            //
            int newClimb = helis[position].ClimbTo1000;
            TimeSpan timeSpan = TimeSpan.FromSeconds(newClimb);
            string climbToShow = timeSpan.ToString(@"mm\:ss");
            txtClimbTo1000.Text = climbToShow;
            //
            txtThrustToWeightRatio.Text=helis[position].ThrustToWeightRatio.ToString();
            txtAGMCount.Text = helis[position].AGMCount.ToString() + context.Resources.GetString(Resource.String.AbbrITEMS);
            txtASMCount.Text = helis[position].ASMCount.ToString() + context.Resources.GetString(Resource.String.AbbrITEMS);


            ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(context);
            ISharedPreferencesEditor editor = prefs.Edit();
            var switchchecked = prefs.GetBoolean("key_kmhtomph", false);
            if (switchchecked)
            {
                var maxSpeed = helis[position].MaxSpeed * 0.621371192;
                var aGMRange = helis[position].AGMRange * 3.28084;
                var aGMArmorPenetration = helis[position].AGMArmorPenetration * 0.039370;
                maxSpeed = System.Math.Round(maxSpeed, 0);
                aGMRange = System.Math.Round(aGMRange, 0);
                aGMArmorPenetration = System.Math.Round(aGMArmorPenetration, 2);

                txtMaxSpeed.Text = maxSpeed + context.Resources.GetString(Resource.String.AbbrMPH);
                txtAGMArmorPenetration.Text = aGMArmorPenetration + context.Resources.GetString(Resource.String.AbbrINCH);
                txtAGMRange.Text = aGMRange + context.Resources.GetString(Resource.String.AbbrFEET);
            }
            else
            {
                txtMaxSpeed.Text = helis[position].MaxSpeed.ToString() + context.Resources.GetString(Resource.String.AbbrKM_H);
                txtAGMArmorPenetration.Text = helis[position].AGMArmorPenetration.ToString() + context.Resources.GetString(Resource.String.AbbrMM);
                txtAGMRange.Text = helis[position].AGMRange.ToString() + context.Resources.GetString(Resource.String.AbbrMETER);

            }

                if (TheBestHeli.SelectedTask == 1)
            {
                txtMaxSpeed.Alpha = 1;
                theBestIco1.Alpha = 1;
            }
            if (TheBestHeli.SelectedTask == 2)
            {
                txtClimbTo1000.Alpha = 1;
                theBestIco2.Alpha = 1;
            }
            if (TheBestHeli.SelectedTask == 3)
            {
                txtThrustToWeightRatio.Alpha = 1;
                theBestIco3.Alpha = 1;
            }
            if (TheBestHeli.SelectedTask == 4)
            {
                txtAGMCount.Alpha = 1;
                theBestIco4.Alpha = 1;
            }
            if (TheBestHeli.SelectedTask == 5)
            {
                txtAGMArmorPenetration.Alpha = 1;
                theBestIco5.Alpha = 1;
            }
            if (TheBestHeli.SelectedTask == 6)
            {
                txtAGMRange.Alpha = 1;
                theBestIco6.Alpha = 1;
            }
            if (TheBestHeli.SelectedTask == 7)
            {
                txtASMCount.Alpha = 1;
                theBestIco7.Alpha = 1;
            }

            return view;
        }
        /// <summary>
        /// Create a Control
        /// </summary>
        /// <param name="text">case string of the created control</param>
        /// <param name="position">A position the created control will be located</param>
        /// <returns>View for the created control</returns>
        private View CreateControl(string text, Position position)
        {
            // A View that contain a control element
            View view = new View();

            // CheckBox sample
            if (text == mCaseString[0])
            {
                // TextLabel for the checkbox
                mtextLabelCheckBox        = new TextLabel("CheckBox");
                mtextLabelCheckBox.Size2D = new Size2D(250, 60);
                mtextLabelCheckBox.HorizontalAlignment = HorizontalAlignment.Center;
                mtextLabelCheckBox.VerticalAlignment   = VerticalAlignment.Center;
                // Set the position of checkbox.
                mtextLabelCheckBox.PositionUsesPivotPoint = true;
                mtextLabelCheckBox.PivotPoint             = PivotPoint.Center;
                mtextLabelCheckBox.ParentOrigin           = ParentOrigin.Center;
                mtextLabelCheckBox.Position        = new Position(0, -55, 0);
                mtextLabelCheckBox.PointSize       = mLargePointSize;
                mtextLabelCheckBox.BackgroundColor = Color.White;
                mtextLabelCheckBox.FontFamily      = "SamsungOneUI_200";

                view.Add(mtextLabelCheckBox);

                // Create three CheckBoxs
                Position         checkBoxStartPosition = new Position(100, 0, 0);
                CheckBoxButton[] checkBox = new CheckBoxButton[3];
                for (int i = 0; i < 3; ++i)
                {
                    // New CheckBox
                    checkBox[i] = new CheckBoxButton();
                    // Set the CheckBox position
                    checkBox[i].Position = checkBoxStartPosition + new Position(0, 40, 0) * i;
                    checkBox[i].PositionUsesPivotPoint = true;
                    checkBox[i].PivotPoint             = PivotPoint.CenterLeft;
                    checkBox[i].ParentOrigin           = ParentOrigin.CenterLeft;
                    // Make Image Visual for the selected checkbox visual
                    checkBox[i].SelectedVisual = CreateImageVisual(mResourceUrl + "/CheckBox/Selected.png");
                    // Make Image Visual for the unselected checkbox visual
                    checkBox[i].UnselectedVisual = CreateImageVisual(mResourceUrl + "/CheckBox/Unselected.png");
                    checkBox[i].Scale            = new Vector3(0.8f, 0.8f, 0.8f);
                    // Add a callback function for the StateChanged signal
                    checkBox[i].StateChanged += OnCheckBoxChanged;
                    view.Add(checkBox[i]);
                }
                // Make Text Visual
                // Set the Label of Checkbox
                checkBox[0].Label = CreateTextVisual("Shadow", mMiddlePointSize + 2, Color.White);
                checkBox[1].Label = CreateTextVisual("Color", mMiddlePointSize + 2, Color.White);
                checkBox[2].Label = CreateTextVisual("Underline", mMiddlePointSize + 2, Color.White);
            }
            else if (text == mCaseString[1])
            {
                // TextLabel for the RadioButton
                mtextLabelRadio        = new TextLabel("Radio Button");
                mtextLabelRadio.Size2D = new Size2D(250, 60);
                mtextLabelRadio.HorizontalAlignment = HorizontalAlignment.Center;
                mtextLabelRadio.VerticalAlignment   = VerticalAlignment.Center;
                // Set the position of textLabel.
                mtextLabelRadio.PositionUsesPivotPoint = true;
                mtextLabelRadio.PivotPoint             = PivotPoint.Center;
                mtextLabelRadio.ParentOrigin           = ParentOrigin.Center;
                mtextLabelRadio.Position        = new Position(0, -55, 0);
                mtextLabelRadio.PointSize       = mLargePointSize;
                mtextLabelRadio.BackgroundColor = Color.White;
                mtextLabelRadio.FontFamily      = "SamsungOneUI_200";

                view.Add(mtextLabelRadio);

                // Create three RadioButton
                Position      checkBoxStartPosition = new Position(100, 0, 0);
                RadioButton[] radioButton           = new RadioButton[3];
                for (int i = 0; i < 3; ++i)
                {
                    // New RadioButton
                    radioButton[i] = new RadioButton();
                    // Set the RadioButton position
                    radioButton[i].Position = checkBoxStartPosition + new Position(0, 40, 0) * i;
                    radioButton[i].PositionUsesPivotPoint = true;
                    radioButton[i].PivotPoint             = PivotPoint.CenterLeft;
                    radioButton[i].ParentOrigin           = ParentOrigin.CenterLeft;
                    // Make Image Visual for the selected RadioButton visual
                    radioButton[i].SelectedVisual = CreateImageVisual(mResourceUrl + "/RadioButton/Selected.png");
                    // Make Image Visual for the unselected RadioButton visual
                    radioButton[i].UnselectedVisual = CreateImageVisual(mResourceUrl + "/RadioButton/Unselected.png");
                    radioButton[i].Scale            = new Vector3(0.5f, 0.5f, 0.5f);
                    // Add a callback function for the StateChanged signal
                    radioButton[i].StateChanged += OnRadioButtonChanged;;
                    view.Add(radioButton[i]);
                }
                // Make Text Visual
                // Set the Label of RadioButton
                radioButton[0].Label = CreateTextVisual("Red", mMiddlePointSize * 2.0f, Color.White);
                radioButton[1].Label = CreateTextVisual("Green", mMiddlePointSize * 2.0f, Color.White);
                radioButton[2].Label = CreateTextVisual("Blue", mMiddlePointSize * 2.0f, Color.White);
            }
            else if (text == mCaseString[2])
            {
                // TextLabel for Slider
                TextLabel mtextLabelSlider = new TextLabel("Slider");
                mtextLabelSlider.Size2D = new Size2D(250, 60);
                mtextLabelSlider.HorizontalAlignment = HorizontalAlignment.Center;
                mtextLabelSlider.VerticalAlignment   = VerticalAlignment.Center;
                // Set the position of textLabel.
                mtextLabelSlider.PositionUsesPivotPoint = true;
                mtextLabelSlider.PivotPoint             = PivotPoint.Center;
                mtextLabelSlider.ParentOrigin           = ParentOrigin.Center;
                mtextLabelSlider.Position        = new Position(0, -55, 0);
                mtextLabelSlider.PointSize       = mLargePointSize;
                mtextLabelSlider.BackgroundColor = Color.White;
                mtextLabelSlider.FontFamily      = "SamsungOneUI_200";

                view.Add(mtextLabelSlider);

                // A new Slider
                mSlider = new Slider();
                // Set the Slider position
                mSlider.PositionUsesPivotPoint = true;
                mSlider.PivotPoint             = PivotPoint.Center;
                mSlider.ParentOrigin           = ParentOrigin.Center;
                mSlider.Size2D = new Size2D(300, 25);
                // Set the Popup and Value properties
                mSlider.ShowPopup = false;
                mSlider.ShowValue = false;
                // Set the Lower Bound and Upper Bound values of the Slider
                mSlider.LowerBound = 0.0f;
                mSlider.UpperBound = 100.0f;
                // Set the start value
                mSlider.Value = 50;

                // Create unselected handle visual.
                PropertyMap hanldeUnSelectedVisualMap = new PropertyMap();
                hanldeUnSelectedVisualMap.Add("visualType", new PropertyValue("IMAGE"));
                // Set image visual size
                hanldeUnSelectedVisualMap.Add("size", new PropertyValue(new Vector2(4, 25)));
                // Set image path url
                hanldeUnSelectedVisualMap.Add("url", new PropertyValue(mResourceUrl + "/Slider/img_slider_handler_h_selected.png"));
                mSlider.HandleVisual = hanldeUnSelectedVisualMap;

                // Create progress visual map.
                PropertyMap progressVisualMap = new PropertyMap();
                progressVisualMap.Add("visualType", new PropertyValue("IMAGE"));
                // Set image visual size
                progressVisualMap.Add("size", new PropertyValue(new Vector2(10, 4)));
                // Set image path url
                progressVisualMap.Add("url", new PropertyValue(mResourceUrl + "/Slider/img_slider_progress.png"));
                mSlider.ProgressVisual = progressVisualMap;

                // Create track visual map.
                PropertyMap trackVisualMap = new PropertyMap();
                trackVisualMap.Add("visualType", new PropertyValue("IMAGE"));
                // Set image visual size
                trackVisualMap.Add("size", new PropertyValue(new Vector2(10, 4)));
                // Set image path url
                trackVisualMap.Add("url", new PropertyValue(mResourceUrl + "/Slider/img_slider_track.png"));
                mSlider.TrackVisual = trackVisualMap;

                view.Add(mSlider);
            }
            else if (text == mCaseString[3])
            {
                // TextLabel for ProgressBar
                TextLabel mtextLabelProgressBar = new TextLabel("Progress Bar");
                mtextLabelProgressBar.Size2D = new Size2D(250, 60);
                mtextLabelProgressBar.HorizontalAlignment = HorizontalAlignment.Center;
                mtextLabelProgressBar.VerticalAlignment   = VerticalAlignment.Center;
                // Set the position of textLabel.
                mtextLabelProgressBar.PositionUsesPivotPoint = true;
                mtextLabelProgressBar.PivotPoint             = PivotPoint.Center;
                mtextLabelProgressBar.ParentOrigin           = ParentOrigin.Center;
                mtextLabelProgressBar.Position        = new Position(0, -55, 0);
                mtextLabelProgressBar.PointSize       = mLargePointSize;
                mtextLabelProgressBar.BackgroundColor = Color.White;
                mtextLabelProgressBar.FontFamily      = "SamsungOneUI_200";

                view.Add(mtextLabelProgressBar);

                // A new ProgressBar
                mProgressBar = new ProgressBar();
                // Set the Slider position
                mProgressBar.PositionUsesPivotPoint = true;
                mProgressBar.PivotPoint             = PivotPoint.Center;
                mProgressBar.ParentOrigin           = ParentOrigin.Center;
                mProgressBar.Size2D = new Size2D(300, 4);

                // Create ProgressVisual
                PropertyMap progressMap = new PropertyMap();
                progressMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
                // Set image path url
                progressMap.Add(ImageVisualProperty.URL, new PropertyValue(mResourceUrl + "/ProgressBar/img_viewer_progress_0_129_198_100.9.png"));
                mProgressBar.ProgressVisual = progressMap;

                // Create TrackVisual
                PropertyMap trackMap = new PropertyMap();
                trackMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
                // Set image path url
                trackMap.Add(ImageVisualProperty.URL, new PropertyValue(mResourceUrl + "/ProgressBar/img_viewer_progress_255_255_255_100.9.png"));
                mProgressBar.TrackVisual = trackMap;

                // Set Interminate visual properties
                PropertyArray indeterminateVisualAnimation = new PropertyArray();

                // Create a property map for the IndeterminateVisualAnimation
                PropertyMap transitionMap = new PropertyMap();
                transitionMap.Add("target", new PropertyValue("indeterminateVisual"));
                transitionMap.Add("property", new PropertyValue("offset"));
                transitionMap.Add("initialValue", new PropertyValue(new Vector2(0.0f, 0.0f)));
                transitionMap.Add("targetValue", new PropertyValue(new Vector2(100.0f, 0.0f)));
                PropertyMap animator = new PropertyMap();
                animator.Add("alphaFunction", new PropertyValue("EASE_IN_OUT_BACK"));
                PropertyMap timePeriod = new PropertyMap();
                timePeriod.Add("delay", new PropertyValue(0.5f));
                timePeriod.Add("duration", new PropertyValue(100.0f));
                animator.Add("timePeriod", new PropertyValue(timePeriod));
                transitionMap.Add("animator", new PropertyValue(animator));
                indeterminateVisualAnimation.PushBack(new PropertyValue(transitionMap));

                mProgressBar.Indeterminate                = false;
                mProgressBar.IndeterminateVisual          = trackMap;
                mProgressBar.IndeterminateVisualAnimation = indeterminateVisualAnimation;

                view.Add(mProgressBar);

                // Create TextLabel that notices current progress
                TextLabel progressText = new TextLabel();
                // Set TextLabel position
                progressText.PositionUsesPivotPoint = true;
                progressText.HorizontalAlignment    = HorizontalAlignment.Center;
                progressText.VerticalAlignment      = VerticalAlignment.Center;
                progressText.ParentOrigin           = ParentOrigin.Center;
                progressText.PivotPoint             = PivotPoint.Center;
                progressText.FontFamily             = "Samsung One 400";
                progressText.Position2D             = new Position2D(150, 20);
                progressText.PointSize = mMiddlePointSize;
                // Set the default Text
                progressText.Text = (mProgressBar.ProgressValue * 100).ToString() + "%";
                // Set the text color
                progressText.TextColor = Color.White;
                view.Add(progressText);

                // Create Timer to show the intermediate progress state
                Timer timer = new Timer(50);
                // Timer Callback function
                timer.Tick += (obj, e) =>
                {
                    if (mProgressBar != null)
                    {
                        // Compute current progress
                        float progress = (float)Math.Round(mProgressBar.ProgressValue, 2);

                        // If the progress is complete
                        // Reset the progressValue to 0.0f
                        if (progress == 1.0f)
                        {
                            mProgressBar.ProgressValue = 0.0f;
                            progressText.Text          = (mProgressBar.ProgressValue * 100).ToString() + "%";
                            return(true);
                        }
                        // For the every step, add progressValue uniformly
                        else
                        {
                            mProgressBar.ProgressValue = progress + 0.01f;
                            progressText.Text          = (mProgressBar.ProgressValue * 100).ToString() + "%";
                            return(true);
                        }
                    }
                    else
                    {
                        return(true);
                    }
                };
                timer.Start();
            }
            // Set the common properties
            view.Size2D = mWindowSize;
            view.PositionUsesPivotPoint = true;
            view.PivotPoint             = PivotPoint.CenterLeft;
            view.ParentOrigin           = ParentOrigin.CenterLeft;
            view.Position = position;

            return(view);
        }
 // Constructor
 public TouchDelegateComposite(View view) : base(unusedRect, view)
 {
 }
Beispiel #49
0
        internal CoreMargin PrepareChart(AxisOrientation source, ChartCore chart)
        {
            if (!(Math.Abs(TopLimit - BotLimit) > S * .01) || !ShowLabels)
            {
                return(new CoreMargin());
            }

            CalculateSeparator(chart, source);

            var f = GetFormatter();

            var currentMargin = new CoreMargin();
            var tolerance     = S / 10;

            InitializeGarbageCollector();

            var bl = Math.Ceiling(BotLimit / Magnitude) * Magnitude;

            for (var i = bl; i <= TopLimit - (EvaluatesUnitWidth ? 1 : 0); i += S)
            {
                SeparatorElementCore asc;

                var key = Math.Round(i / tolerance) * tolerance;
                if (!Cache.TryGetValue(key, out asc))
                {
                    asc = new SeparatorElementCore {
                        IsNew = true
                    };
                    Cache[key] = asc;
                }
                else
                {
                    asc.IsNew = false;
                }

                View.RenderSeparator(asc, Chart);

                asc.Key   = key;
                asc.Value = i;
                asc.GarbageCollectorIndex = GarbageCollectorIndex;

                var labelsMargin = asc.View.UpdateLabel(f(i), this, source);

                currentMargin.Width = labelsMargin.TakenWidth > currentMargin.Width
                    ? labelsMargin.TakenWidth
                    : currentMargin.Width;
                currentMargin.Height = labelsMargin.TakenHeight > currentMargin.Height
                    ? labelsMargin.TakenHeight
                    : currentMargin.Height;

                currentMargin.Left = labelsMargin.Left > currentMargin.Left
                    ? labelsMargin.Left
                    : currentMargin.Left;
                currentMargin.Right = labelsMargin.Right > currentMargin.Right
                    ? labelsMargin.Right
                    : currentMargin.Right;

                currentMargin.Top = labelsMargin.Top > currentMargin.Top
                    ? labelsMargin.Top
                    : currentMargin.Top;
                currentMargin.Bottom = labelsMargin.Bottom > currentMargin.Bottom
                    ? labelsMargin.Bottom
                    : currentMargin.Bottom;

                if (LastAxisMax == null)
                {
                    asc.State = SeparationState.InitialAdd;
                    continue;
                }

                asc.State = SeparationState.Keep;
            }
            return(currentMargin);
        }
Beispiel #50
0
        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            base.DidRotate(fromInterfaceOrientation);

            View.SetNeedsLayout();
        }
Beispiel #51
0
 public void Include(View view)
 {
     view.Click += (s, e) => view.ContentDescription = view.ContentDescription + "";
 }
Beispiel #52
0
 public ContainerView(Context context, View view, IMauiContext mauiContext) : base(context)
 {
     _mauiContext = mauiContext ?? throw new ArgumentNullException(nameof(mauiContext));
     View         = view;
 }
Beispiel #53
0
 public override void OnViewCreated(View view, Bundle savedInstanceState)
 {
     base.OnViewCreated(view, savedInstanceState);
     UpdateSector();
 }
Beispiel #54
0
 public override View GetDropDownView(int position, View convertView, ViewGroup parent)
 {
     throw new MvxException(@"GetDropDownView should not be called for layout list items");
 }
		/* (non-Javadoc)
		 * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View, android.view.ViewGroup.LayoutParams)
		 */
        public void SetBehindContentView(View v, ViewGroup.LayoutParams lp)
		{
			mHelper.SetBehindContentView(v, lp);
		}
Beispiel #56
0
        void StructureGrid_Touch(object sender, View.TouchEventArgs e)
        {
            int cellsize = structureGrid.Width / 10;

            if (e.Event.Action == MotionEventActions.Down)
            {
                Console.WriteLine("starting drag");
                startX = e.Event.GetX();
                startY = e.Event.GetY();


                lastX = startX;
                lastY = startY;


                var newDragView = FindViewAtLoc((int)(lastX / cellsize), (int)(lastY / cellsize), 1, 1);
                SetSelectedView(newDragView);
                if (dragView != null)
                {
                    StructureObj theStruct = StructureForView(dragView);
                    lastXLoc   = theStruct.xLoc;
                    lastYLoc   = theStruct.yLoc;
                    dx         = startX - dragView.Left;
                    dy         = startY - dragView.Top;
                    dragWidth  = dragView.Width;
                    dragHeight = dragView.Height;
                    xWidth     = dragWidth / cellsize;
                    yWidth     = dragHeight / cellsize;
                    lastX      = startX - dx;
                    lastY      = startY - dy;
                    isDragging = true;
                    int newLeft = (int)(lastX / cellsize) * cellsize;
                    int newTop  = (int)(lastY / cellsize) * cellsize;
                    maxX = 10 - xWidth;
                    maxY = 10 - yWidth;

                    selectionRect.Visibility = ViewStates.Visible;
                    selectionRect.BringToFront();
                    //selectionRect.Layout(newLeft, newTop, newLeft + dragWidth, newTop + dragHeight);

                    FrameLayout.LayoutParams gridLayout = (FrameLayout.LayoutParams)selectionRect.LayoutParameters;
                    gridLayout.SetMargins(newLeft, newTop, 0, 0);
                    gridLayout.Width  = dragWidth;
                    gridLayout.Height = dragHeight;
                    selectionRect.LayoutParameters = gridLayout;
                    selectionRect.ForceLayout();
                    selectionRect.SetBackgroundColor(new Color(0, 255, 0, 128));

                    selectionFrame.Visibility = ViewStates.Invisible;
                    selectionFrame.BringToFront();
                    //selectionFrame.Layout(newLeft-2, newTop-2, newLeft + dragWidth+2, newTop + dragHeight+2);
                }
            }
            else if (e.Event.Action == MotionEventActions.Move)
            {
                if (isDragging)
                {
                    lastX = e.Event.GetX() - dx;
                    lastY = e.Event.GetY() - dy;
                    dragView.Layout((int)lastX, (int)lastY, (int)lastX + dragWidth, (int)lastY + dragHeight);
                    int newLeft = (int)(lastX / cellsize);
                    int newTop  = (int)(lastY / cellsize);
                    if (newLeft > maxX)
                    {
                        newLeft = maxX;
                    }
                    if (newTop > maxY)
                    {
                        newTop = maxY;
                    }
                    newLeft *= cellsize;
                    newTop  *= cellsize;
                    Console.WriteLine(string.Format("dragging - {0}, {1}", lastX, lastY));
                    selectionRect.Layout(newLeft, newTop, newLeft + dragWidth, newTop + dragHeight);
                    hitView = FindViewAtLoc((int)(lastX / cellsize), (int)(lastY / cellsize), xWidth, yWidth, dragView);
                    if (hitView == null)
                    {
                        selectionRect.SetBackgroundColor(new Color(0, 255, 0, 128));
                    }
                    else
                    {
                        selectionRect.SetBackgroundColor(new Color(255, 0, 0, 128));
                    }

                    selectionFrame.Visibility = ViewStates.Invisible;
                }
            }
            else if (e.Event.Action == MotionEventActions.Up)
            {
                if (isDragging)
                {
                    isDragging = false;

                    int newX = (int)(lastX / cellsize);
                    int newY = (int)(lastY / cellsize);
                    if (newX > maxX)
                    {
                        newX = maxX;
                    }
                    if (newY > maxY)
                    {
                        newY = maxY;
                    }

                    if (hitView != null)
                    {
                        newX = lastXLoc;
                        newY = lastYLoc;
                    }
                    FrameLayout.LayoutParams gridLayout = (FrameLayout.LayoutParams)dragView.LayoutParameters;
                    gridLayout.SetMargins(newX * cellsize, newY * cellsize, 0, 0);
                    dragView.LayoutParameters = gridLayout;
                    dragView.ForceLayout();

                    Console.WriteLine(string.Format("end drag - {0}, {1}", lastX, lastY));
                    if (newX != lastXLoc || newY != lastYLoc)
                    {
                        UpdateStructureLoc(dragView, newX, newY);
                        isDirty = true;
                    }
                    gridLayout = (FrameLayout.LayoutParams)selectionFrame.LayoutParameters;
                    gridLayout.SetMargins(newX * cellsize - 2, newY * cellsize - 2, 0, 0);
                    gridLayout.Width  = dragWidth + 4;
                    gridLayout.Height = dragHeight + 4;
                    selectionFrame.LayoutParameters = gridLayout;
                    selectionFrame.ForceLayout();
                    selectionFrame.Visibility = ViewStates.Visible;



                    hitView = null;
                    selectionRect.Visibility = ViewStates.Invisible;
                }
            }
            else
            {
                selectionRect.Visibility = ViewStates.Invisible;
                dragView   = null;
                hitView    = null;
                isDragging = false;
                SetSelectedView(null);
            }

            e.Handled = true;
        }
Beispiel #57
0
 //-----------------------------------------------------------------------------
 public void SelectEvents_OnStopPreSelect(Point modelPosition, Point2d viewPosition, View view)
 {
     m_parentCmd.OnStopPreSelect(modelPosition, viewPosition, view);
 }
Beispiel #58
0
        private StructureObj StructureForView(View theView)
        {
            long theId = (long)theView.Tag;

            return(parent.pop.curSector.structures.Find(str => str.Id == theId));
        }
Beispiel #59
0
        //-----------------------------------------------------------------------------

        public void SelectEvents_OnPreSelectMouseMove(object preSelectEntity, Point modelPosition, Point2d viewPosition, View view)
        {
            m_parentCmd.OnPreSelectMouseMove(preSelectEntity, modelPosition, viewPosition, view);
        }
		/* (non-Javadoc)
		 * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View)
		 */
		public void SetBehindContentView(View v)
		{
            SetBehindContentView(v, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));
		}