private void RemoveResources(object name) { string tmp = name.ToString(); Resources tmpRes = ProjectResources.Where(x => x.Name == tmp).FirstOrDefault(); ProjectResources.Remove(tmpRes); }
public TreeNodeResourceFileCollection(ProjectResources owner, bool isForSelection) : base(owner, isForSelection) { Text = "Files"; ImageIndex = TreeViewObjectExplorer.IMG_FILES; SelectedImageIndex = ImageIndex; }
public void LoadData(ProjectResources resources, Control p) { _parent = p; _resman = resources; OnLanguageChanged(); CreateContextmenu(); }
public async Task <ActionResult> Create(ProjectResources prjRes) { try { string url = ConfigurationManager.AppSettings["URL"].ToString(); if (ModelState.IsValid) { //IDAL dal = (new DALFactory()).GetInstance(); //dal.AddProjectSkillResources(prjRes); InitializeServiceClient(); ProjectResourcesRequest projectResourcesRequest = new ProjectResourcesRequest(); projectResourcesRequest.projectId = prjRes.projectId; projectResourcesRequest.projectName = prjRes.projectName; projectResourcesRequest.skillResources = prjRes.skillResources; HttpResponseMessage response = await client.PostAsJsonAsync("Project/AddProjectSkillResources", projectResourcesRequest); } ViewBag.Message = "Data updated"; return(View(prjRes)); } catch (Exception ex) { //UserManager user = (UserManager)Session["CurrentUser"]; //LogHelper.AddLog("ProjectAvailableResourceController", ex.Message, ex.StackTrace, "HCL.Academy.Web", user.EmailID); TelemetryClient telemetry = new TelemetryClient(); telemetry.TrackException(ex); return(View(prjRes)); } }
public TreeNodeResourceStringCollection(ProjectResources owner, bool isForSelection) : base(owner, isForSelection) { Text = "Strings"; ImageIndex = TreeViewObjectExplorer.IMG_STRINGS; SelectedImageIndex = ImageIndex; }
public TreeNodeResourceManager(ProjectResources owner, bool isForSelection) : base(owner, isForSelection) { Text = "Resources"; ImageIndex = TreeViewObjectExplorer.IMG_RESMAN; SelectedImageIndex = ImageIndex; }
public TreeNodeResourceAudioCollection(ProjectResources owner, bool isForSelection) : base(owner, isForSelection) { Text = "Audios"; ImageIndex = TreeViewObjectExplorer.IMG_AUDIOS; SelectedImageIndex = ImageIndex; }
private void AddResources() { bool checkName = true; foreach (var t in ProjectResources) { if (t.Name == NameResource) { checkName = false; } } if (checkName == true && CostResource > 0 && NameResource.Length > 0) { Resources resource = new Resources { Name = NameResource, Cost = CostResource }; ProjectResources.Add(resource); } else { ErrorMessage er = new ErrorMessage("The name exists or cost <= 0!"); er.ShowDialog(); } }
/// <summary> /// /// </summary> /// <param name="method"></param> /// <returns>CodeEventReferenceExpression</returns> public override CodeExpression GetReferenceCode(IMethodCompile method, CodeStatementCollection statements, bool forValue) { if (IsStatic) { if (typeof(ProjectResources).Equals(ObjectType)) { ProjectResources rm = ((LimnorProject)(method.ModuleProject)).GetProjectSingleData <ProjectResources>(); return(new CodeEventReferenceExpression(new CodeTypeReferenceExpression(rm.HelpClassName), this.MemberName)); } return(new CodeEventReferenceExpression(new CodeTypeReferenceExpression(ObjectType), this.MemberName)); } else { CodeExpression targetObject; if (this.Owner != null) { targetObject = this.Owner.GetReferenceCode(method, statements, forValue); } else { targetObject = this.Holder.GetReferenceCode(method, statements, forValue); } return(new CodeEventReferenceExpression(OnGetTargetObject(targetObject), this.MemberName)); } }
public TreeNodeResourceIconCollection(ProjectResources owner, bool isForSelection) : base(owner, isForSelection) { Text = "Icons"; ImageIndex = TreeViewObjectExplorer.IMG_ICONS; SelectedImageIndex = ImageIndex; }
public void CreateContextmenu() { ContextMenu mnu = new ContextMenu(); mnu.MenuItems.Add(new MenuItemWithBitmap("Edit resources", mnu_editresources, Resource1.resx.ToBitmap())); // if (_resman.Languages.Count > 0) { mnu.MenuItems.Add(new MenuItem("-")); MenuItemWithBitmap m = new MenuItemWithBitmap("default culture", mnu_changeCulture, TreeViewObjectExplorer.GetLangaugeBitmapByName(string.Empty)); m.Tag = ""; mnu.MenuItems.Add(m); foreach (string s in _resman.Languages) { CultureInfo c = CultureInfo.GetCultureInfo(s); if (c != null) { m = new MenuItemWithBitmap(ProjectResources.CultureDisplay(c), mnu_changeCulture, TreeViewObjectExplorer.GetLangaugeBitmapByName(s)); m.Tag = s; mnu.MenuItems.Add(m); } } } // this.ContextMenu = mnu; lblLang.ContextMenu = mnu; picLang.ContextMenu = mnu; }
public void LoadResourceNodes <T>() where T : ResourcePointer { ProjectResources rm = this.ResourceManager; IList <T> rs = rm.GetResourceList <T>(); SortedList <string, TreeNode> s = new SortedList <string, TreeNode>(); foreach (T r in rs) { if (IsForSelection) { TreeNodeResourceCode tn = new TreeNodeResourceCode(r); s.Add(tn.Text, tn); } else { TreeNodeResource tn = r.CreateTreeNode(); s.Add(tn.Text, tn); } } IEnumerator <KeyValuePair <string, TreeNode> > en = s.GetEnumerator(); while (en.MoveNext()) { Nodes.Add(en.Current.Value); } }
public void OnPostSerialize(ObjectIDmap objMap, XmlNode objectNode, bool saved, object serializer) { if (_resource == null) { ProjectResources rh = objMap.Project.GetProjectSingleData <ProjectResources>(); _resource = rh.GetResourcePointerById(_id); } }
public TreeNodeCultureCollection(ProjectResources rm) { _resman = rm; Text = "Languages"; ImageIndex = TreeViewObjectExplorer.IMG_LANGUAGES; SelectedImageIndex = ImageIndex; LoadLanguages(); }
public void LoadData(LimnorProject proj) { _resman = proj.GetProjectSingleData <ProjectResources>(); _curLanguageName = _resman.DesignerLanguageName; _rootTreeNode = new TreeNodeResourceManager(_resman, false); treeView1.Nodes.Add(_rootTreeNode); _rootTreeNode.Expand(); Text = Text + " - " + proj.ProjectName; }
public static void AddResourceCollections(ProjectResources manager, TreeNodeCollection parent, bool forSelection) { parent.Add(new TreeNodeResourceStringCollection(manager, forSelection)); parent.Add(new TreeNodeResourceImageCollection(manager, forSelection)); parent.Add(new TreeNodeResourceIconCollection(manager, forSelection)); parent.Add(new TreeNodeResourceAudioCollection(manager, forSelection)); parent.Add(new TreeNodeResourceFileCollection(manager, forSelection)); parent.Add(new TreeNodeResourceFilePathCollection(manager, forSelection)); }
public async Task <ActionResult> Edit( [Bind(Include = "Id,ProjectTaskId,ResourceId")] ProjectResources projectResources) { if (ModelState.IsValid) { db.Entry(projectResources).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.ResourceId = new SelectList(db.Resources, "Id", "Name", projectResources.ResourceId); ViewBag.ProjectTaskId = new SelectList(db.ProjectTasks, "Id", "Name", projectResources.ProjectTaskId); return(View(projectResources)); }
public ActionResult Create(ProjectResources prjRes) { try { IDAL dal = (new DALFactory()).GetInstance(); dal.AddExpectedProjectResourceCountByProjectId(prjRes); } catch (Exception ex) { UserManager user = (UserManager)Session["CurrentUser"]; LogHelper.AddLog(new LogEntity(AppConstant.PartitionError, user.EmailID.ToString(), AppConstant.ApplicationName, "ProjectExpectedResource, Manage", ex.Message, ex.StackTrace)); } return(View(prjRes)); }
public TreeNodeCulture(CultureInfo c, ProjectResources rm) { _culture = c; _resman = rm; Text = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} [{1}]", c.NativeName, c.Name); if (string.CompareOrdinal(_culture.Name, _resman.DesignerLanguageName) == 0) { ImageIndex = TreeViewObjectExplorer.GetSelectedImageIndex(TreeViewObjectExplorer.GetLangaugeImageByName(_culture.Name)); } else { ImageIndex = TreeViewObjectExplorer.GetLangaugeImageByName(_culture.Name); } SelectedImageIndex = ImageIndex; }
public ProjectResources GetExpectedProjectResourceCountByProjectId(RequestBase req, int ProjectID) { ProjectResources pr = new ProjectResources(); try { SqlSvrDAL dal = new SqlSvrDAL(req.ClientInfo); pr = dal.GetExpectedProjectResourceCountByProjectId(ProjectID); //Gets Expected Project Resouce Count for a particular Project } catch (Exception ex) { //LogHelper.AddLog("ProjectController,GetExpectedProjectResourceCountByProjectId", ex.Message, ex.StackTrace, "HCL.Academy.Service", req.ClientInfo.emailId); TelemetryClient telemetry = new TelemetryClient(); telemetry.TrackException(ex); } return(pr); }
public TreeNodeCulture(string nm, ProjectResources rm) { _name = nm; _resman = rm; if (string.CompareOrdinal("zh", nm) == 0) { _culture = CultureInfo.GetCultureInfo("zh-CHT"); Text = "中文 zh"; if (string.CompareOrdinal(_culture.Name, _resman.DesignerLanguageName) == 0) { ImageIndex = TreeViewObjectExplorer.GetSelectedImageIndex(TreeViewObjectExplorer.GetLangaugeImageByName(_culture.Name)); } else { ImageIndex = TreeViewObjectExplorer.GetLangaugeImageByName(_culture.Name); } SelectedImageIndex = ImageIndex; } }
public void LoadData(ClassPointer pointer) { _pointer = pointer; ProjectResources rm = _pointer.Project.GetProjectSingleData <ProjectResources>(); Dictionary <IProperty, UInt32> map = _pointer.ResourceMap; _table = new DataTable(); _table.Columns.Add("Property", typeof(object)); _table.Columns.Add("Resource name", typeof(object)); Dictionary <IProperty, UInt32> .Enumerator en = map.GetEnumerator(); while (en.MoveNext()) { ResourcePointer rp = rm.GetResourcePointerById(en.Current.Value); if (rp != null) { _table.Rows.Add(en.Current.Key, rp); } } dataGridView1.DataSource = _table; }
public bool AddExpectedProjectResourceCountByProjectId(ProjectResourcesRequest request) { bool status = false; try { ProjectResources prjRes = new ProjectResources(); prjRes.projectId = request.projectId; prjRes.skillResources = request.skillResources; SqlSvrDAL dal = new SqlSvrDAL(request.ClientInfo); status = dal.AddExpectedProjectResourceCountByProjectId(prjRes); } catch (Exception ex) { //LogHelper.AddLog("ProjectController,AddExpectedProjectResourceCountByProjectId", ex.Message, ex.StackTrace, "HCL.Academy.Service", request.ClientInfo.emailId); TelemetryClient telemetry = new TelemetryClient(); telemetry.TrackException(ex); } return(status); }
public ActionResult Create(ProjectResources prjRes) { try { string url = ConfigurationManager.AppSettings["URL"].ToString(); if (ModelState.IsValid) { IDAL dal = (new DALFactory()).GetInstance(); dal.AddProjectSkillResources(prjRes); } ViewBag.Message = "Data updated"; return(View(prjRes)); } catch (Exception ex) { UserManager user = (UserManager)Session["CurrentUser"]; LogHelper.AddLog(new LogEntity(AppConstant.PartitionError, user.EmailID.ToString(), AppConstant.ApplicationName, "ProjectAvailableResource, Create", ex.Message, ex.StackTrace)); return(View(prjRes)); } }
public async Task <ActionResult> Create(ProjectResources prjRes) { InitializeServiceClient(); try { ProjectResourcesRequest req = new ProjectResourcesRequest(); req.projectId = prjRes.projectId; req.projectName = prjRes.projectName; req.skillResources = prjRes.skillResources; HttpResponseMessage response = await client.PostAsJsonAsync("Project/AddExpectedProjectResourceCountByProjectId", req); } catch (Exception ex) { //UserManager user = (UserManager)Session["CurrentUser"]; //LogHelper.AddLog("ProjectExpectedResourceController", ex.Message, ex.StackTrace, "HCL.Academy.Web", user.EmailID); TelemetryClient telemetry = new TelemetryClient(); telemetry.TrackException(ex); } client.Dispose(); return(View(prjRes)); }
// GET: ProjectExpectedResource/Create /// <summary> /// Sets the expected resources and their respective skills /// </summary> /// <param name="projectID"></param> /// <returns></returns> public async Task <ActionResult> Create(int projectID) { ProjectResources prjRes = new ProjectResources(); //prjRes.projectId = projectID; //prjRes.skillResources = new List<SkillResource>(); InitializeServiceClient(); try { //IDAL dal = (new DALFactory()).GetInstance(); //prjRes = dal.GetExpectedProjectResourceCountByProjectId(projectID); HttpResponseMessage response = await client.PostAsJsonAsync("Project/GetExpectedProjectResourceCountByProjectId?projectID=" + projectID, req); prjRes = await response.Content.ReadAsAsync <ProjectResources>(); } catch (Exception ex) { //UserManager user = (UserManager)Session["CurrentUser"]; //LogHelper.AddLog("ProjectExpectedResourceController", ex.Message, ex.StackTrace, "HCL.Academy.Web", user.EmailID); TelemetryClient telemetry = new TelemetryClient(); telemetry.TrackException(ex); } return(View(prjRes)); }
public ResourceFromFile(ProjectResources owner) : base(owner) { }
public ResourcePointer(ProjectResources owner) { _owner = owner; }
public ResourcePointerImage(ProjectResources owner) : base(owner) { }
public ResourcePointerAudio(ProjectResources owner) : base(owner) { _font = new Font("Times New Roman", 12); }