Example #1
0
 public static DesignDto Map(Design design)
 {
     return new DesignDto
     {
         DesignId    = design.Id,
         Name        = design.Name,
     };
 }
 private void AddDesign(Design.Design design)
 {
     if (Designs.Contains(design) == false)
     {
         Designs.Add(design);
         NotifyPropertyChanged("Designs");
     }
 }
        public Product Update(String productKey, Design design, FileInfo newFile)
        {
            var uri = Map("/products/{0}/update-design/{1}", productKey, design.Key);

            design.Filename = newFile.FullName;

            return Submit(uri, design);
        }
 private IEnumerable<Field> ToFields(Design design)
 {
     return new List<Field> {
      	new Field {Name = "designs[][ref]",				Value = design.Reference},
      	new Field {Name = "designs[][filename]",		Value = Path.GetFileName(design.Filename)},
      	new Field {Name = "designs[][quantity]",		Value = design.Quantity.ToString()},
      	new Field {Name = "designs[][material_key]",	Value = design.MaterialKey}
     };
 }
Example #5
0
        public void setupEnvironment0()
        {
            location = new Sector(sys, new System.Drawing.Point());

            SimulatedEmpire simemp = new SimulatedEmpire(testships2.empire("TestEmpOne", new Culture(), new Race()));
            Design <Ship>   design = testships2.EscortDUC(gal, simemp.Empire, testships2.Components(gal));
            SpaceVehicle    sv     = testships2.testShip(simemp, design, 100);

            location.Place(sv);

            battle = new Battle_Space(location);
        }
Example #6
0
        protected async Task <Design> CreateAndSaveTestDesign()
        {
            var design = new Design {
                Title = "Test", DesignCoords = "test"
            };

            _db.Design.Add(design);
            await _db.SaveChangesAsync();

            Assert.NotEqual(0, design.Id);
            return(design);
        }
        private Product Submit(Uri uri, Design design)
        {
            var payload = new Payload {
                {"ref"				, design.Reference},
                {"filename"			, Path.GetFileName(design.Filename)},
                {"uploaded_data"	, new DataItem(new FileInfo(design.Filename), "xxx")},
                {"quantity"			, design.Quantity},
                {"material_key"		, design.MaterialKey}
            };

            return Run(uri, payload);
        }
Example #8
0
        public void IPxDesign_Dispose_IsNotNull()
        {
            IMMPxNode node;

            using (Design design = new Design(new WorkRequest(base.PxApplication)))
            {
                node = design.Node;
                design.Delete();
            }

            Assert.IsNotNull(node);
        }
 public override void Render(Design design)
 {
     base.Render(design);
     if (nameField != null)
     {
         nameField.text = (design as DescribedDesign).GetName();
     }
     if (descriptionField != null)
     {
         descriptionField.text = (design as DescribedDesign).GetDescription();
     }
 }
        public Product Update(String productKey, Design design)
        {
            var uri = Map("/products/{0}/update-design/{1}", productKey, design.Key);

            var payload = new Payload {
                {"ref"			, design.Reference},
                {"quantity"		, design.Quantity},
                {"material_key"	, design.MaterialKey}
            };

            return Run(uri, payload);
        }
Example #11
0
        public async Task <IActionResult> Create([Bind("Id, Title, Description")] Design newDesign)
        {
            if (ModelState.IsValid)
            {
                this._context.Add(newDesign);
                await this._context.SaveChangesAsync();

                return(RedirectToAction("Display", new { Id = newDesign.Id }));
            }

            return(View(newDesign));
        }
 /// <summary>
 /// Retire un Design de la liste
 /// </summary>
 /// <param name="inputTable">L'Design à modifier</param>
 public void RemoveDesign(Design design)
 {
     foreach (BrowserData data in this.liste)
     {
         if (data.name == design.name)
         {
             this.liste.Remove(data);
             this.cvs.DeferRefresh();
             return;
         }
     }
 }
Example #13
0
        // TODO  можно написать конкретную специализацию
        // (напр установщик дверей).

        protected void DownloadBar()
        {
            Design.Blue();
            for (int i = 0; i < 5; i++)
            {
                Console.Write(" #");
                System.Threading.Thread.Sleep(100);
            }
            Console.WriteLine("   Нажмите любую клавишу.");
            Design.Default();
            Console.ReadKey();
        }
Example #14
0
        private void ReloadBrowser()
        {
            DesignParser designParser = new DesignParser();

            this.design = designParser.Parse(editor.GetDesignText(), SetProgress, out string error);

            webBrowser.DocumentText = HtmlHelper.GetDesignInHtml(design);

            SetMenus(enabled: true);

            webBrowser.Visible = true;
        }
        public ActionResult CreateNew(int?parentCategoryId)
        {
            var model = new Design();

            model.Status = true;
            if (parentCategoryId.HasValue)
            {
                model.ParentCategoryId = parentCategoryId.Value;
            }
            ViewData["ParentCategories"] = _categoryService.GetParents(1);//parent type production
            return(View(model));
        }
Example #16
0
        private Design checkDesign(Design design)
        {
            if (!this.refitOrders.ContainsKey(design))
            {
                return(design);
            }

            this.changeItem  = true;
            this.deleteItem |= this.refitOrders[design] == null;

            return(this.refitOrders[design]);
        }
Example #17
0
 private bool StyleNameExists(Design design, IStyle style, string newName)
 {
     if (design == null)
     {
         throw new ArgumentNullException("design");
     }
     if (style == null)
     {
         throw new ArgumentNullException("style");
     }
     return(design.FindStyleByName(newName, style.GetType()) != null);
 }
Example #18
0
        public void Setup()
        {
            // initialize galaxy
            new Galaxy();
            Mod.Current = new Mod();

            // initialize star systems
            here = new StarSystem(0)
            {
                Name = "Here"
            };
            there = new StarSystem(0)
            {
                Name = "There"
            };
            Galaxy.Current.StarSystemLocations.Add(new ObjectLocation <StarSystem>(here, new Point()));
            Galaxy.Current.StarSystemLocations.Add(new ObjectLocation <StarSystem>(there, new Point(1, 1)));

            // initialize empires
            seekers      = new Empire();
            seekers.Name = "Seekers";
            hiders       = new Empire();
            hiders.Name  = "Hiders";
            Galaxy.Current.Empires.Add(seekers);
            Galaxy.Current.Empires.Add(hiders);

            //. initialize exploration
            here.ExploredByEmpires.Add(seekers);

            // initialize ships
            Assert.IsNotNull(Mod.Current);
            var dsDesign = new Design <Ship>();

            dsDesign.BaseName = "Destroyer";
            dsDesign.CreateHull();
            dsDesign.Owner  = seekers;
            destroyer       = dsDesign.Instantiate();
            destroyer.Owner = seekers;
            var subDesign = new Design <Ship>();

            subDesign.BaseName = "Submarine";
            subDesign.CreateHull();
            subDesign.Owner = hiders;
            submarine       = subDesign.Instantiate();
            submarine.Owner = hiders;

            // place ships
            destroyer.Sector = here.GetSector(0, 0);
            submarine.Sector = here.GetSector(0, 0);

            // register objects
            Galaxy.Current.CleanGameState();
        }
Example #19
0
        private void calcRefitCosts(Design design, ShipFormulaSet shipFormulas)
        {
            this.RefitCosts.Add(design, new Dictionary <Design, double>());

            var otherDesigns = this.DesignStats.Keys.Where(x => x.Hull.TypeInfo == design.Hull.TypeInfo && x != design).ToList();

            foreach (var otherDesign in otherDesigns)
            {
                this.RefitCosts[design].Add(otherDesign, refitCost(design, otherDesign, shipFormulas));
                this.RefitCosts[otherDesign].Add(design, refitCost(otherDesign, design, shipFormulas));
            }
        }
Example #20
0
        public DataTable GetDesigningCharge_DAL(Design aDesign)
        {
            SqlConnection  connection = DBConnection.OpenConnection();
            string         query      = "select DesignCost from Design where DID=" + aDesign.DID + "";
            SqlCommand     action     = new SqlCommand(query, connection);
            DataTable      dTable     = new DataTable();
            SqlDataAdapter Sda        = new SqlDataAdapter();

            Sda.SelectCommand = action;
            Sda.Fill(dTable);
            return(dTable);
        }
Example #21
0
 public void Configure(Design design)
 {
     foreach (UnitComponent c in design.Components)
     {
         ComponentEngine engine = c.Component as ComponentEngine;
         if (engine != null)
         {
             Tonnage  = engine.Tonnage / 10;
             BaseCost = engine.EngineRating / 10;
         }
     }
 }
Example #22
0
        public void FillContractInfo(Design design, ContractSettings contractSettings, StorageDirectory folder)
        {
            var templateFile         = new StorageFile(folder.RelativePathParts.Merge(contractSettings.TemplateName));
            var templatePresentation = _powerPointObject.Presentations.Open(Path.Combine(templateFile.LocalPath, contractSettings.TemplateName), WithWindow: MsoTriState.msoFalse);

            foreach (var shape in GetContractInfoShapes(contractSettings, templatePresentation))
            {
                shape.Copy();
                design.SlideMaster.Shapes.Paste();
            }
            templatePresentation.Close();
        }
Example #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = Request.Path;
     Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
     if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
     {
         intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
     }
     else
     {
         Response.Redirect("/admin/login.aspx");
     }
     oDesign = new Design(intProfile, dsn);
     if (!IsPostBack)
     {
         LoadList();
     }
     if (Request.QueryString["id"] == null)
     {
         if (Request.QueryString["add"] == null)
         {
             LoopRepeater();
         }
         else
         {
             panAdd.Visible    = true;
             btnDelete.Enabled = false;
         }
     }
     else
     {
         panAdd.Visible = true;
         intID          = Int32.Parse(Request.QueryString["id"]);
         if (intID > 0)
         {
             if (!IsPostBack)
             {
                 DataSet ds = oDesign.GetApproverGroup(intID);
                 hdnId.Value            = intID.ToString();
                 ddlGroup.SelectedValue = ds.Tables[0].Rows[0]["groupid"].ToString();
                 chkExceptions.Checked  = (ds.Tables[0].Rows[0]["only_exceptions"].ToString() == "1");
                 chkEnabled.Checked     = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                 btnAdd.Text            = "Update";
             }
         }
         else
         {
             btnDelete.Enabled = false;
         }
     }
     btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
 }
Example #24
0
        /// <summary>
        /// Mostra o saldo do usuario baseando-se na lista de transações
        /// </summary>
        private static void MostrarSaldo()
        {
            double           Saldo = 0;
            List <Transacao> lista = Database.BuscarTransacao(Database.usuarioLogado.ID);

            foreach (Transacao item in lista)
            {
                Saldo += item.ValorDespesa;
            }
            Console.WriteLine("");
            Design.MensagemSucesso($"Seu saldo é de R${Saldo.ToString("N2")}");
            Console.WriteLine("");
        }
Example #25
0
        private void calcRefitCosts(Design design, StaticsDB statics)
        {
            this.RefitCosts[design] = new Dictionary <Design, double>();

            var otherDesigns = this.DesignStats.Keys.Where(x => x.Hull.TypeInfo == design.Hull.TypeInfo && x != design).ToList();
            var designStats  = this.DesignStats[design];

            foreach (var otherDesign in otherDesigns)
            {
                this.RefitCosts[design][otherDesign] = refitCost(design, otherDesign, this.DesignStats[otherDesign], statics);
                this.RefitCosts[otherDesign][design] = refitCost(otherDesign, design, designStats, statics);
            }
        }
        /// <summary>
        /// Rajoute une design
        /// </summary>
        /// <param name="inputTable">L'design à modifier</param>
        public void AddDesign(Design design)
        {
            BrowserData data = new BrowserData();

            if (design.oid.HasValue)
            {
                data.oid = design.oid.Value;
            }
            data.name  = design.name;
            data.group = design.group.name;
            this.liste.Add(data);
            this.cvs.DeferRefresh();
        }
Example #27
0
		public ProfileDesignView(Profile profile, Event eveInvitingTo, int dims) : base(dims)
		{
			this.profile = profile;
			design = Design.NameAndButtons;
			SetupButtons(true);
			if (!eveInvitingTo.Attendees.Exists(p => p.ProfileId == profile.ProfileId))
			{
				HandleButtonRequests(delegate ()
				{
					return _dataManager.EventApiManager.InviteProfilesToEvent(eveInvitingTo.EventId, new List<Profile> { profile });
				}, addBtn, "Invite", "Invited");
			}
		}
Example #28
0
        public DesignDto Add(DesignDto dto)
        {
            var item = new Design()
            {
                Name     = dto.Name,
                Comment  = dto.Comment,
                Price    = dto.Price,
                PriceVip = dto.PriceVip,
            };

            _dao.Create(item);
            return(_map(item));
        }
Example #29
0
        public ConfigWindow(ModuleSPEngine m) :
            base(new Guid("41f4fc6f-06b4-4d6c-9774-908f46beffc0"),
                 "SPEngine Config", new Rect(100, 100, 615, 320))
        {
            designScroll   = new Vector2();
            module         = m;
            inputThrust    = "";
            inputIgnitions = "1";
            fetchDesign();
            Family f = Core.Instance.families[module.familyLetter[0]];

            currentDesign = new Design(f, 0);
        }
 public DataTable GetDesigningCharge_BLL(Design aDesign)
 {
     if (aDesign.DID <= 0)
     {
         return(null);
     }
     else
     {
         OrderDAL  aOrderDal = new OrderDAL();
         DataTable dTable    = aOrderDal.GetDesigningCharge_DAL(aDesign);
         return(dTable);
     }
 }
        static void Main(string[] args)
        {
            //Apresentação
            Design.MensagemChamativa("Seja bem vindo!");
            Design.MensagemProximo("Aperte qualquer tecla para continuar");

            //Todo o programa ae ;-;
            FinancaDeMesa.Classe.Database.CarregarDatabase();
            FinancaDeMesa.Classe.Controller.Menu.Deslogado();

            //Fim
            Design.MensagemProximo("Aperte qualquer tecla para sair");
        }
Example #32
0
        public void IPxDesign_Initialize_IsTrue()
        {
            DataTable table = base.PxApplication.ExecuteQuery("SELECT ID FROM " + base.PxApplication.GetQualifiedTableName(ArcFM.Process.WorkflowManager.Tables.Design));

            if (table.Rows.Count > 0)
            {
                int nodeID = table.Rows[0].Field <int>(0);
                using (Design design = new Design(base.PxApplication, nodeID))
                {
                    Assert.IsTrue(design.Valid);
                }
            }
        }
        private TWMIFEXTDSGN_PT MapObjectToIfEntity(Design design, Point point, ExtDesignKey key)
        {
            TWMIFEXTDSGN_PT entity = new TWMIFEXTDSGN_PT();

            entity.CD_SEQ_EXTDSGN     = GetIfSequenceNo();
            entity.TS_EXTDSGN         = key.TsExtDsgn;
            entity.ID_OPER            = key.IdOper;
            entity.NO_POINT           = point.PointNumber;
            entity.NO_POINT_SPAN      = point.PointSpanNumber;
            entity.CD_DIST            = design.District;
            entity.CD_WR              = (long)int.Parse(point.WorkRequest);
            entity.AD_GR_1            = string.Empty;
            entity.AD_GR_2            = string.Empty;
            entity.TXT_DESN           = string.Empty;
            entity.DT_RPTD            = null;
            entity.DT_IN_SERVICE      = null;
            entity.CD_TOWN_RANGE_SECT = string.Empty;
            entity.CD_TAX_DIST        = string.Empty;
            entity.CD_SIDE_OF_STREET  = string.Empty;
            entity.IND_WORK_STATUS    = " ";
            entity.IND_MAIN_STATUS    = "N"; //N = not designated, L = long, S = short
            entity.IND_PROCESS        = "A"; //A = add, M = modify, D = delete
            entity.CD_ENTITY          = string.Empty;
            entity.CD_ISOLATION_SECT  = string.Empty;
            entity.CD_LANDMARK        = string.Empty;
            entity.CD_POLITICAL_SUB   = string.Empty;
            entity.CD_SCHOOL_TAX      = string.Empty;
            entity.AMT_FIXED_BID      = null;
            entity.NO_DRAWING         = string.Empty;
            if (point.Length == null)
            {
                entity.LN_SPAN = (decimal?)0.00;
            }
            else
            {
                entity.LN_SPAN = (decimal?)Convert.ToDecimal(point.Length);
            }
            entity.NO_MAP             = string.Empty;
            entity.AD_POINT           = string.Empty;
            entity.ID_POINT           = string.IsNullOrEmpty(point.PointID) ? string.Empty : point.PointID;
            entity.CD_CREW            = string.Empty;
            entity.IND_CNTCR_CALC_MTH = "1";   //1, 2, 3, 4
            entity.FG_ERROR           = "N";
            entity.CD_BID_ITEM        = string.Empty;
            entity.FG_RWORKS          = "N"; //"N" or "Y", default is "N"
            entity.CD_SEQ_ERROR_RUN   = null;
            entity.NO_COMPLEXITY      = null;
            entity.QT_BID_ITEM        = 0;

            return(entity);
        }
Example #34
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(width, height);
            Console.SetBufferSize(width, height + 500);
            Design.Headline(Application.ProductName.Replace('_', ' '));

            int inputSize = 10;

            BaseTrans[]   inputs = new BaseTrans[inputSize];
            NeuralNetwork nn     = new NeuralNetwork();
            Random        r      = new Random();

            for (int i = 0; i < inputSize; i++)
            {
                inputs[i]       = new BaseTrans();
                inputs[i].Value = r.Next(100);
                nn.AddInput(inputs[i]);
            }
            BaseRec r1 = new BaseRec();

            //BaseReciever r2 = new BaseReciever
            nn.AddOutput(r1);
            nn.AddOutput(r1);
            //nn.AddOutput(r2);

            //int iterationNum = 10000;
            //double sum = 0
            nn.Build();

            LearningSet ls = nn.GenerateLearningSet();

            foreach (BaseTrans input in inputs)
            {
                ls.GiveInput(input, r.Next(100));
            }
            ls.ExpectOutput(r1, 100);

            nn.Practice(ls);

            nn.Activate();

            //Console.WriteLine(r1.Value);

            //sum += r1.Value;
            //Console.WriteLine(r1.Value);


            //Console.WriteLine(sum / iterationNum);

            //Design.End();
        }
        public static void GerarRelatorioUsuario()
        {
            // Criando o relatório
            Document documento = new Document();

            //Adicionando uma seção ao relatório
            Section secao = documento.AddSection();

            //Adicionando um parágrafo à seção
            Paragraph titulo = secao.AddParagraph();

            titulo.Format.HorizontalAlignment = HorizontalAlignment.Center;

            titulo.AppendText($"{Database.usuarioLogado.ID} | {Database.usuarioLogado.Nome} | {Database.usuarioLogado.Email}");
            secao.AddParagraph().AppendText("\n");

            List <Transacao> transacoes = Database.BuscarTransacao(Database.usuarioLogado.ID);

            if (transacoes.Count > 0)
            {
                foreach (Transacao tra in transacoes)
                {
                    if (tra != null)
                    {
                        Paragraph[] informacao = new Paragraph[4];
                        for (int i = 0; i < 4; i++)
                        {
                            informacao[i] = secao.AddParagraph();
                        }

                        Paragraph tituloTransacao = secao.AddParagraph();
                        tituloTransacao.AppendText($"Transação {tra.ID}");
                        informacao[0].AppendText($"Tipo : {tra.tipo}");
                        informacao[1].AppendText($"Data : {tra.dataTransacao}");
                        informacao[2].AppendText($"Descrição : {tra.Descricao}");
                        informacao[3].AppendText($"Valor : R${tra.ValorDespesa.ToString("N2")}");
                        secao.AddParagraph().AppendText("\n");
                    }
                }

                //Salvando o relatório
                documento.SaveToFile($@"{Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}\relatorio{Database.usuarioLogado.Nome}.docx", FileFormat.Docx);
                Design.MensagemSucesso($@"Arquivo relatorio{Database.usuarioLogado.Nome}.docx criado na area de trabalho");
                Design.MensagemProximo("Aperte qualquer botão para continuar (exceto o printscreen)");
            }
            else
            {
                Design.MensagemErro($"O Usuario {Database.usuarioLogado.Nome} não efetuou transações");
                Design.MensagemProximo("Aperte qualquer botão para continuar (exceto o printscreen)");
            }
        }
Example #36
0
        private void ListBoxItem_Selected(object sender, RoutedEventArgs e)
        {
            if (sender is not ListBoxItem item)
            {
                return;
            }
            BrushAnimation animation = new()
            {
                To       = Design.GetBrushFromResource(Design.StyleBrush.TextColorBrush),
                Duration = TimeSpan.FromSeconds(0.2),
            };

            item.BeginAnimation(Control.ForegroundProperty, animation);
        }
Example #37
0
 private void btnPlayerView_Click(object sender, EventArgs e)
 {
     if (gridEmpires.SelectedRows.Count == 1)
     {
         var status = (EmpireStatus)gridEmpires.SelectedRows[0].DataBoundItem;
         var emp    = status.Empire;
         if (emp.IsDefeated)
         {
             MessageBox.Show(emp + " is defeated. There is nothing to view.");
         }
         else
         {
             if (MessageBox.Show("Really show the player view for " + emp + "?\nThis is intended primarily for AI debugging, but it can also be used to cheat in multiplayer!", "Confirm Player View", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
             {
                 if (emp.IsPlayerEmpire)
                 {
                     // load GAM file if possible
                     var savefile = Galaxy.Current.GetGameSavePath(emp);
                     try
                     {
                         Galaxy.Load(savefile);
                     }
                     catch (IOException)
                     {
                         MessageBox.Show("Could not load " + savefile + ". Attempting to recreate player view.");
                         Galaxy.Current.CurrentEmpire = emp;
                         Galaxy.Current.Redact();
                     }
                 }
                 else
                 {
                     // AI empires have no GAM files, so create their views in memory
                     Galaxy.Current.CurrentEmpire = emp;
                     Galaxy.Current.Redact();
                 }
                 Design.ImportFromLibrary();
                 var form = new MainGameForm(true, false);
                 Hide();
                 this.ShowChildForm(form);
                 Show();
                 ReloadGalaxy();
                 Bind();                         // in case the host saved the commands
             }
         }
     }
     else
     {
         MessageBox.Show("Please select an empire in order to show the player view.");
     }
 }
        private void Validate(Design design)
        {
            if (null == design)
                throw new ArgumentException("Cannot create a product without at least one Design.", "design");

            if (null == design.Filename)
                throw new ArgumentException("Cannot create a product unless the Design has a file.", "design");

            var theDesignFileExistsOnDisk = FileExists(design);

            un.less(theDesignFileExistsOnDisk, () => {
               		throw new FileNotFoundException(
               			"Cannot create a product unless the Design has a file that exists on disk. " +
               			"Unable to find file \"" + design.Filename + "\""
                );
            });
        }
Example #39
0
		//Design design = Design.ShowAll;

		public GroupDesignView(Group group, int dims, Design design) : base(dims)
		{
			this.group = group;
			try
			{
				SetInfo(group.ImageSource, group.Name, group.Description, design, ModelType.Group);
			}
			catch (Exception ex) { }

			subjBtn.Clicked += (sender, e) => { 
				if (dims >= 200)
				{
					OtherFunctions of = new OtherFunctions();
					of.ViewImages(new List<string>() { group.ImageSource });
					//subjBtn.Clicked += (sender, e) => { App.coreView.setContentViewReplaceCurrent(new InspectController(group), 1); };
				}
				else {
					App.coreView.setContentViewWithQueue(new InspectController(group));
				}
			};

			setInfo(dims);
		}
Example #40
0
		public ProfileDesignView(Profile profile, Group grpInvitingTo, int dims) : base(dims)
		{
			this.profile = profile;
			design = Design.NameAndButtons;
			SetupButtons(true);
			if (grpInvitingTo.ProfilesRequestingToJoin.Exists(p => p.ProfileId == profile.ProfileId))
			{
				HandleButtonRequests(delegate ()
				{
					return _dataManager.GroupApiManager.InviteDeclineToGroup(grpInvitingTo.GroupId, true, new List<Profile> { profile });
				}, addBtn, "Accept", "Acceptd");
				HandleButtonRequests(delegate ()
				{
					return _dataManager.GroupApiManager.InviteDeclineToGroup(grpInvitingTo.GroupId, false, new List<Profile> { profile });
				}, removeBtn, "Decline", "Declined");
			} else  if (!grpInvitingTo.Members.Exists(p => p.ProfileId == profile.ProfileId))
			{
				HandleButtonRequests(delegate ()
				{
					return _dataManager.GroupApiManager.InviteDeclineToGroup(grpInvitingTo.GroupId, true, new List<Profile> { profile });
				}, addBtn, "Invite", "Invited");
			}
			setPillButtonLayout(new List<Button>() {addBtn, removeBtn });
		}
Example #41
0
		/*
		public ProfileDesignView(Profile profile, Organization orgInvitingTo, int dims) : base(dims)
		{
			this.profile = profile;
			design = Design.NameAndButtons;
			SetupButtons(true);
			if (!orgInvitingTo.Members.Exists(p => p.ProfileId == profile.ProfileId))
			{
				HandleButtonRequests(delegate ()
				{
					return _dataManager.OrganizationApiManager.InviteToOrganization(orgInvitingTo.OrganizationId, profile);
				}, addBtn, "Invite", "Invited");
			} 
		} */

		public ProfileDesignView(Profile profile, int dims, bool clickable, Design design) : base(dims)
		{
			this.profile = profile;
			this.design = design;
			SetupButtons(clickable);
			if (profile.ProfileId != App.StoredUserFacebookId)
			{
				if (App.userProfile.RecievedFriendRequests != null && App.userProfile.RecievedFriendRequests.Exists(p => p.ProfileId == profile.ProfileId))
				{
					addBtn.Clicked += async (sender, e) =>
					{
						await _dataManager.ProfileApiManager.RequestDeclineAcceptUnfriend(profile.ProfileId, true);
						if (clickable)
						{
							await App.coreView.updateHomeView();
							App.coreView.setContentView(4);
						}
						else {
							App.coreView.setContentViewWithQueue(new InspectController(profile));
						}
					};


					HandleButtonRequests(delegate ()
					{
						return _dataManager.ProfileApiManager.RequestDeclineAcceptUnfriend(profile.ProfileId, true);
					}, addBtn, "Accept", "Accepted");
					HandleButtonRequests(delegate ()
					{
						return _dataManager.ProfileApiManager.RequestDeclineAcceptUnfriend(profile.ProfileId, false);
					}, removeBtn, "Decline", "Declined");
				}
				else if (App.userProfile.SentFriendRequests != null && App.userProfile.SentFriendRequests.Exists(p => p.ProfileId == profile.ProfileId))
				{
					HandleButtonRequests(delegate ()
					{
						return _dataManager.ProfileApiManager.RequestDeclineAcceptUnfriend(profile.ProfileId, false);
					}, addBtn, "Cancel Request", "Canceled");
				}
				else if (App.userProfile.Friends.Exists(p => p.ProfileId == profile.ProfileId))
				{
					HandleButtonRequests(delegate ()
					{
						return _dataManager.ProfileApiManager.RequestDeclineAcceptUnfriend(profile.ProfileId, false);
					}, removeBtn, "Remove", "Removed");
				}
				else {
					HandleButtonRequests(delegate ()
					{
						return _dataManager.ProfileApiManager.RequestDeclineAcceptUnfriend(profile.ProfileId, true);
					}, addBtn, "Add", "RequestSent");
				}
			} else {
				if (profile.ProfileId == App.userProfile.ProfileId && dims >= 200)
				{
					editBtn.IsVisible = true;
					/*
					bool edit = false;
					App.coreView.topBar.setRightButton("ic_menu.png").Clicked += async (sender, e) =>
					{
						List<Action> actions = new List<Action>();
						List<string> titles = new List<string>();
						List<string> images = new List<string>();

						actions.Add(() =>
						{
							ShowHideEditLayout(!edit);
							if (edit)
							{
								SetInfo(profile.ImageSource, profile.Name, profile.Description, design, ModelType.Profile);
							}
							edit = !edit;
						});
						titles.Add("Edit");
						images.Add("ic_settings.png");

						await App.coreView.DisplayOptions(actions, titles, images);
					}; */
				}
			}
		}
Example #42
0
 /// <summary>
 /// Initializes a new instance of <see cref="T:Dataweb.NShape.WinFormsUI.StyleUITypeEditor" />.
 /// </summary>
 public StyleUITypeEditor()
 {
     if (designBuffer == null) {
         string msg =
             string.Format(
                 "{0} is not set. Set the static property {1}.Design to a reference of the current design before creating the UI type editor.",
                 typeof (Design).Name, GetType().Name);
         throw new NShapeInternalException(msg);
     }
     this.project = projectBuffer;
     this.design = designBuffer;
 }
 partial void DeleteDesign(Design instance);
 partial void UpdateDesign(Design instance);
            public void AddService(Type serviceType, Design.ServiceCreatorCallback callback, bool promote)
            {
                if (promote && this._parentContainer != null) {
                    this._parentContainer.AddService(serviceType, callback, promote);
                } else {
                    lock (this._lock) {
                        if (this._services.ContainsKey(serviceType)) {
                            throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.DataAnnotationsResources.ValidationContextServiceContainer_ItemAlreadyExists, serviceType), "serviceType");
                        }

                        this._services.Add(serviceType, callback);
                    }
                }
            }
Example #46
0
 private void CloseDesign(Design.Design design)
 {
     // TODO
 }
Example #47
0
 public void RegisterTitleTextWithStringsFile(Design design)
 {
     TitleTextStringID = Strings.AddString(design.ActivityName, TitleText, this.WidgetType);
 }
Example #48
0
        /// <summary>Gets a list of resources for the specified resource set.</summary>
        /// <param name="resourceSetName">The name of the resource set to get resources for.</param>
        /// <returns>List of resources for the specified resource set. Note that if such resource set was not yet seen by this context
        /// it will get created (with empty list).</returns>
        public IList GetResourceSetEntities(string resourceSetName)
        {
            List<object> entities;
            if (resourceSetName != typeof(Design).Name)
            {
                if (!this.resourceSetsStorage.TryGetValue(resourceSetName, out entities))
                {
                    entities = new List<object>();
                    this.resourceSetsStorage[resourceSetName] = entities;
                }
            }
            else
            {
                entities = new List<object>();
                entities.Add(new Design(){ Data="", FileName="new_design"
                    //, FileURL=""
                });
                //se están pidiendo los diseños grabados en el servidor. Tengo que elaborar la lista.
                // Create a StringBuilder used to create the result string
                StringBuilder resultText = new StringBuilder();
                // Create an FileIOPermission for accessing the HttpContext.Current.Server.MapPath("/storage") folder
                String folderPath = HttpContext.Current.Server.MapPath(Servidor.STORAGE_RELATIVE_PATH);
                FileIOPermission permFileIO = new FileIOPermission(FileIOPermissionAccess.AllAccess, folderPath);

                try
                {
                    // Demand the permission to access the C:\Temp folder.
                    permFileIO.Demand();

                    System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(folderPath);

                    foreach (var fileInfo in di.GetFiles("*.design"))
                    {
                        Design ds = new Design() { FileName = fileInfo.Name.Replace(".design",""), TimeStamp = fileInfo.LastWriteTime.ToString("dd/MM/yyyy hh:mm")
                            //, FileURL = fileInfo.FullName.Replace(HttpContext.Current.Request.ServerVariables["APPL_PHYSICAL_PATH"], "/").Replace(@"\", "/")
                        };
                        entities.Add(ds);
                    }
                }
                catch (SecurityException se)
                {
                    resultText.Append("The demand for permission to access the " + folderPath + " folder failed.\nException message: ");
                    resultText.Append(se.Message);
                    resultText.Append("\n\n");
                }
            }

            return entities;
        }
Example #49
0
 /// <ToBeCompleted></ToBeCompleted>
 public RepositoryDesignEventArgs(Design design)
 {
     if (design == null) throw new ArgumentNullException("design");
     this.design = design;
 }
 /// <summary>
 /// Contstructs a new service container that has a parent container, making this container
 /// a wrapper around the parent container.  Calls to <c>AddService</c> and <c>RemoveService</c>
 /// will promote to the parent container by default, unless <paramref name="promote"/> is
 /// specified as <c>false</c> on those calls.
 /// </summary>
 /// <param name="parentContainer">The parent container to wrap into this container.</param>
 internal ValidationContextServiceContainer(Design.IServiceContainer parentContainer) {
     this._parentContainer = parentContainer;
 }
Example #51
0
 private void designController_Uninitialized(object sender, EventArgs e)
 {
     selectedStyle = null;
     selectedDesign = null;
     styleListBox.Items.Clear();
     // Only perform a CancalSetproperty if the probject still exists, otherwise the call will fail.
     if (propertyController.Project != null)
         propertyController.CancelSetProperty();
 }
Example #52
0
 /// <summary>
 ///  Activates the selected design as the project's design.
 /// </summary>
 /// <param name="design"></param>
 public void ActivateDesign(Design design)
 {
     if (Project.Design != design) Project.ApplyDesign(design);
 }
Example #53
0
 public void RegisterTextWithStringsClass(Design design)
 {
     HintTextStringID = Strings.AddString(design.ActivityName, HintText, this.WidgetType);
 }
Example #54
0
        public Database()
        {
            Scene = new Scene
            {
                DisplayWidth = 1535,
                DisplayHeight = 1535,
                ReferenceId = "laura_room.pfs",
            };

            OverlayScene = new Scene
            {
                DisplayWidth = 800,
                DisplayHeight = 450,
                ReferenceId = "OverlayScene.pfs",
            };

            Design = new Design
            {
                DisplayName = "Logo-Picario_1336",
                DisplayWidth = 876,
                DisplayHeight = 318,
                ReferenceId = "3826_LogoPicario_1336.png",
                DesignOptions = new DesignOptions
                {
                    Repeat = true,
                    Width = 60.0,
                    Height = 22.0,
                    Gloss = 0.0,
                    Contrast = 0.7,
                    DropX = 0.3,
                    DropY = 0.5,
                    PlacingPointX = 0.3,
                    PlacingPointY = 0.5,
                    Flip = true,
                    Rotation = 180
                }
            };

            FloorDesign = new Design
            {
                DisplayName = "4298",
                DisplayWidth = 1200,
                DisplayHeight = 800,
                ReferenceId = "3804_4289.jpg",
                DesignOptions = new DesignOptions
                {
                    Repeat = true,
                    Width = 424.0,
                    Height = 283.0,
                    Gloss = 0.0,
                    Contrast = 0.7,
                    DropX = 0.3,
                    DropY = 0.5,
                    PlacingPointX = 0.3,
                    PlacingPointY = 0.5,
                    Flip = true,
                    Rotation = 180
                }
            };

            ContrastDesign = new Design
            {
                DisplayName = "Football",
                DisplayWidth = 4285,
                DisplayHeight = 2710,
                ReferenceId = "3806_Football.png",
                DesignOptions = new DesignOptions
                {
                    Repeat = false,
                    Width = 1134.0,
                    Height = 718.0,
                    Gloss = 0.0,
                    Contrast = 0.9,
                    DropX = 0.5,
                    DropY = 0.5,
                    PlacingPointX = 0.5,
                    PlacingPointY = 0.3,
                    Flip = false,
                    Rotation = 0
                }
            };
        }
Example #55
0
        /// <override></override>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null) {
            #if DEBUG
                if (!(context.PropertyDescriptor is PropertyDescriptorDg))
                    System.Diagnostics.Debug.Print("### The given PropertyDescriptor for {0} is not of type {1}.", value,
                                                   typeof (PropertyDescriptorDg).Name);
                else
                    System.Diagnostics.Debug.Print("### PropertyDescriptor is of type {1}.", value, typeof (PropertyDescriptorDg).Name);
            #endif

                IWindowsFormsEditorService editorService =
                    (IWindowsFormsEditorService) provider.GetService(typeof (IWindowsFormsEditorService));
                if (editorService != null) {
                    // fetch current Design (if changed)
                    if (designBuffer != null && designBuffer != design)
                        design = designBuffer;

                    // Examine edited instances and determine whether the list item "Default Style" should be displayed.
                    bool showItemDefaultStyle = false;
                    bool showItemOpenEditor = false;
                    if (context.Instance is Shape) {
                        showItemDefaultStyle = ((Shape) context.Instance).Template != null;
                        showItemOpenEditor = project.SecurityManager.IsGranted(Permission.Designs);
                    }
                    else if (context.Instance is object[]) {
                        object[] objArr = (object[]) context.Instance;
                        int cnt = objArr.Length;
                        showItemDefaultStyle = true;
                        showItemOpenEditor = project.SecurityManager.IsGranted(Permission.Designs);
                        for (int i = 0; i < cnt; ++i) {
                            Shape shape = objArr[i] as Shape;
                            if (shape == null || shape.Template == null) {
                                showItemDefaultStyle = false;
                                showItemOpenEditor = false;
                                break;
                            }
                        }
                    }

                    StyleListBox styleListBox = null;
                    try {
                        Type styleType = null;
                        if (value == null) {
                            if (context.PropertyDescriptor.PropertyType == typeof (ICapStyle))
                                styleType = typeof (CapStyle);
                            else if (context.PropertyDescriptor.PropertyType == typeof (IColorStyle))
                                styleType = typeof (ColorStyle);
                            else if (context.PropertyDescriptor.PropertyType == typeof (IFillStyle))
                                styleType = typeof (FillStyle);
                            else if (context.PropertyDescriptor.PropertyType == typeof (ICharacterStyle))
                                styleType = typeof (CharacterStyle);
                            else if (context.PropertyDescriptor.PropertyType == typeof (ILineStyle))
                                styleType = typeof (LineStyle);
                            else if (context.PropertyDescriptor.PropertyType == typeof (IParagraphStyle))
                                styleType = typeof (ParagraphStyle);
                            else throw new NShapeUnsupportedValueException(context.PropertyDescriptor.PropertyType);

                            if (project != null)
                                styleListBox = new StyleListBox(editorService, project, design, styleType, showItemDefaultStyle,
                                                                showItemOpenEditor);
                            else styleListBox = new StyleListBox(editorService, design, styleType, showItemDefaultStyle, showItemOpenEditor);
                        }
                        else {
                            if (project != null)
                                styleListBox = new StyleListBox(editorService, project, design, value as Style, showItemDefaultStyle,
                                                                showItemOpenEditor);
                            else
                                styleListBox = new StyleListBox(editorService, design, value as Style, showItemDefaultStyle, showItemOpenEditor);
                        }

                        editorService.DropDownControl(styleListBox);
                        if (styleListBox.SelectedItem is IStyle)
                            value = styleListBox.SelectedItem;
                        else value = null;
                    }
                    finally {
                        if (styleListBox != null) styleListBox.Dispose();
                        styleListBox = null;
                    }
                }
            }
            return value;
        }
 partial void InsertDesign(Design instance);
		public void SetInfo(string source, string name, string description, Design design, ModelType modelType)
		{
			//Image img = new Image() { Source = source };


			ProfileImage.Source = source;
			nameLabel.Text = name;
			//nameLabelEdit.Text = name;
			descriptionLabel.Text = description;
			descriptionLabelEdit.Text = description;
			if (design == Design.Name)
			{
				nameLayout.IsVisible = true;
			}
			else if (design == Design.NameAndButtons)
			{
				nameLayout.IsVisible = true;
				buttonLayout.IsVisible = true;
			}
			else if (design == Design.ShowAll)
			{
				nameLayout.IsVisible = true;
				buttonLayout.IsVisible = true;
				descriptionLabel.IsVisible = true;
				descriptionLayout.IsVisible = true;
				if (!string.IsNullOrWhiteSpace(description))
				{
					descriptionLineOne.IsVisible = true;
					descriptionLineTwo.IsVisible = true;
				}
			}

			if (modelType == ModelType.Group)
			{
				/*
				modelTypeIcon.IsVisible = true;
				modelTypeIcon.Source = "ic_group.png";
				modelTypeIcon2.IsVisible = true;
				modelTypeIcon2.Source = "ic_group.png";
				*/
				//MainButton.BorderColor = Color.FromHex("#ff66aacc");
			}
			else {
				MainButton.IsVisible = false;
			}

		}
 public void AddService(Type serviceType, Design.ServiceCreatorCallback callback) {
     this.AddService(serviceType, callback, true);
 }
Example #59
0
 private void Validate(Design[] designs)
 {
     _validator.Validate(designs);
 }
Example #60
0
        private void Repair(Design.DesignOptions design)
        {
            List<string> combos = new List<string>(design.DesignCombinations.Count);
            foreach (Load.LoadCombination c in design.DesignCombinations)
                combos.Add(c.Name);
            design.DesignCombinations.Clear();

            foreach (Load.AbstractCase aCase in Model.Instance.AbstractCases)
                if (combos.Contains(aCase.Name) && (aCase is Load.LoadCombination))
                    design.DesignCombinations.Add((Load.LoadCombination)aCase);
        }