// Use this for initialization public DualScreen() { MapModel mapModel = MapCache.GetInstance().GetModel(); this.topWindow = new TopWindow(mapModel); this.topWindow.LocalPosition = new Vector2(0, -1.5f); this.bottomWindow = new BottomWindow(mapModel); Roga2dNode frame = new Roga2dNode(); this.AddChild(frame); // Set up Frame Roga2dSprite mainWindow = new Roga2dSprite("UI/frame", new Vector2(160, 240), new Vector2(0, 0), new Rect(0, 0, 160, 240)); frame.AddChild(mainWindow); // Connect PreviewWindow and ControlWindow this.bottomWindow.MessageEvent += this.bottomWindow.ReceiveMessage; this.bottomWindow.MessageEvent += this.topWindow.ReceiveMessage; this.topWindow.MessageEvent += this.bottomWindow.ReceiveMessage; this.topWindow.MessageEvent += this.topWindow.ReceiveMessage; this.lastTouchedPosition = InvalidTouchPosition; }
/// <summary> /// 取消作用于角色组件,虚函数 /// </summary> /// <param name="characterComponent">被取消作用的角色组件</param> /// <returns>是否成功</returns> public virtual bool CancelActOn(BaseComponent characterComponent) { if (!characterComponent) { return false; } return true; }
public override void ComponentInfo(out string[] names, out BaseComponent[] components) { names = new string[1]; components = new BaseComponent[1]; names [0] = Constants.DEATH_STRING; components[0] = m_DeathComponent; }
/// <summary> /// 作用于组件 /// </summary> /// <param name="characterComponent">作用于的组件</param> /// <returns>函数执行是否成功</returns> public override bool ActOn(BaseComponent characterComponent) { if (!base.ActOn(characterComponent)) { return false; } HpComponent hpComponent = ((HpComponent)characterComponent); hpComponent.AddMaxHp(maxHpAddedValue, maxHpAddedRate); hpComponent.AddHp(hpAdded); hpComponent.AddHpRecover(hpRecoverAddedValue, hpRecoverAddedRate); return true; }
/// <summary> /// 作用于组件 /// </summary> /// <param name="characterComponent">作用于的组件</param> /// <returns>函数执行是否成功</returns> public override bool ActOn(BaseComponent characterComponent) { if (!base.ActOn(characterComponent)) { return false; } MpComponent mpComponent = ((MpComponent)characterComponent); mpComponent.AddMaxMp(maxMpAddedValue, maxMpAddedRate); mpComponent.AddMp(mpAdded); mpComponent.AddMpRecover(mpRecoverAddedValue, mpRecoverAddedRate); return true; }
/// <summary> /// 取消作用于组件 /// </summary> /// <param name="component">取消作用于的组件</param> /// <returns>函数执行是否成功</returns> public override bool CancelActOn(BaseComponent component) { if (!base.CancelActOn(component)) { return false; } ResourceComponent resourceComponent = (ResourceComponent)component; if (obtainMoneyRateAddedRate != 0) { resourceComponent.AddObtainMoneyRate(-obtainMoneyRateAddedRate); } return true; }
public override void ComponentInfo(out string[] names, out BaseComponent[] components) { names = new string[3]; components = new BaseComponent[3]; names [0] = Constants.COMBAT_STRING; components [0] = m_CombatComponent; names [1] = Constants.TARGETING_STRING; components [1] = m_TargetingComponent; names [2] = Constants.MOVEMENT_STRING; components [2] = m_MovementComponent; }
public GrabHandles(BaseComponent parent) { handles = new GrabHandle[] { new GrabHandleNW(parent), new GrabHandleN(parent), new GrabHandleNE(parent), new GrabHandleE(parent), new GrabHandleSE(parent), new GrabHandleS(parent), new GrabHandleSW(parent), new GrabHandleW(parent) }; }
/// <summary> /// 作用于组件 /// </summary> /// <param name="component">作用于的组件</param> /// <returns>函数执行是否成功</returns> public override bool ActOn(BaseComponent component) { if (!base.ActOn(component)) { return false; } ResourceComponent resourceComponent = (ResourceComponent)component; if (obtainMoneyRateAddedRate != 0) { resourceComponent.AddObtainMoneyRate(obtainMoneyRateAddedRate); } if (moneyAddedValue > 0) { resourceComponent.AddMoney(moneyAddedValue); } else if (moneyAddedValue < 0) { resourceComponent.LoseMoney(-moneyAddedValue); } return true; }
public ManageClassesSearchPage(BaseComponent parent) : base(parent) { }
/// <summary> /// Создает элемент управления для отображения ссылок на отчеты базового агрегата /// </summary> public BaseComponentLinksFlowLayoutPanel(BaseComponent baseComponent, bool isForecast = false) { _baseComponent = baseComponent; // // linkADStatus // _linkAdStatus.Text = "AD Status"; _linkAdStatus.Margin = _imageLinkLabelMargin; _linkAdStatus.Enabled = true; _linkAdStatus.Margin = _itemPadding; _linkAdStatus.ReflectionType = ReflectionTypes.DisplayInNew; _linkAdStatus.DisplayerRequested += LinkAdStatusDisplayerRequested; Css.ImageLink.Adjust(_linkAdStatus); // // linkDiscrepancies // _linkDiscrepancies.Text = isForecast ? "Forecast" : "Oil Statistics"; _linkDiscrepancies.Margin = _imageLinkLabelMargin; _linkDiscrepancies.Enabled = true; _linkDiscrepancies.Margin = _itemPadding; Css.ImageLink.Adjust(_linkDiscrepancies); _linkDiscrepancies.ReflectionType = ReflectionTypes.DisplayInNew; if (isForecast) { _linkDiscrepancies.DisplayerRequested += LinkDiscrepanciesDisplayerRequested; } else { _linkDiscrepancies.DisplayerRequested += LinkOilStatisticsDisplayerRequested; } // // linkEngineeringOrders // _linkEngineeringOrders.Text = "Engineering Orders"; _linkEngineeringOrders.Margin = _imageLinkLabelMargin; _linkEngineeringOrders.Enabled = true; _linkEngineeringOrders.Margin = _itemPadding; _linkEngineeringOrders.ReflectionType = ReflectionTypes.DisplayInNew; _linkEngineeringOrders.DisplayerRequested += LinkEngineeringOrdersDisplayerRequested; Css.ImageLink.Adjust(_linkEngineeringOrders); // // _linkComponentStatus // _linkComponentStatus.Text = "Component Status"; _linkComponentStatus.Margin = _imageLinkLabelMargin; _linkComponentStatus.Enabled = true; _linkComponentStatus.Margin = _itemPadding; _linkComponentStatus.ReflectionType = ReflectionTypes.DisplayInNew; _linkComponentStatus.DisplayerRequested += LinkComponentStatusDisplayerRequested; Css.ImageLink.Adjust(_linkComponentStatus); // // linkLLPDiskSheetStatus // _linkLlpDiskSheetStatus.Text = "LLP Disk Sheet Status"; _linkLlpDiskSheetStatus.Margin = _imageLinkLabelMargin; _linkLlpDiskSheetStatus.Enabled = true; _linkLlpDiskSheetStatus.Margin = _itemPadding; _linkLlpDiskSheetStatus.ReflectionType = ReflectionTypes.DisplayInNew; _linkLlpDiskSheetStatus.DisplayerRequested += LinkLLPDiskSheetStatusDisplayerRequested; Css.ImageLink.Adjust(_linkLlpDiskSheetStatus); // // linkSBStatus // _linkSbStatus.Text = "SB Status"; _linkSbStatus.Margin = _imageLinkLabelMargin; _linkSbStatus.Enabled = true; _linkSbStatus.Margin = _itemPadding; _linkSbStatus.DisplayerRequested += LinkSbStatusDisplayerRequested; Css.ImageLink.Adjust(_linkSbStatus); BackColor = Css.CommonAppearance.Colors.BackColor; Size = new Size(500, 100); Controls.Add(_linkAdStatus); Controls.Add(_linkEngineeringOrders); Controls.Add(_linkDiscrepancies); Controls.Add(_linkSbStatus); Controls.Add(_linkComponentStatus); if (baseComponent != null && baseComponent.BaseComponentType.ItemId == BaseComponentType.Engine.ItemId) { Controls.Add(_linkLlpDiskSheetStatus); } }
public void PopulateComposant() { Sprite[] sprites = Resources.LoadAll <Sprite>("Field/GrassAtlas"); for (int i = 1; i < N - 1; i++) { for (int j = 1; j < M - 1; j++) { GameObject slot = Pg.transform.GetChild((i) + (j) * (N)).gameObject; //the slot if (slot.transform.childCount > 1) { if (slot.transform.childCount != 2) { Debug.Log("Populate error" + slot.transform.childCount); } BaseComponent bc = slot.transform.GetChild(1).GetComponent <BaseComponent>(); bc.enabled = true; //sometime usefull if exchange from the deck Vector3 v = bc.transform.localPosition; v.z = 0; bc.transform.localPosition = v; bc.transform.localScale = new Vector3(1, 1, 1); composants[i][j] = bc; if (firstPopulate) { slot.GetComponentInChildren <Image>().sprite = sprites[((i + j) % 2) * 2 + +(int)Random.Range(0, 1.999f)]; } } else { if (firstPopulate) { slot.GetComponentInChildren <Image>().sprite = sprites[((i + j) % 2) * 2 + (int)Random.Range(0, 1.999f)]; slot.GetComponentInChildren <Image>().color = Color.white; } GameObject bc = Instantiate(Resources.Load("Components/Empty", typeof(GameObject))) as GameObject; bc.transform.SetParent(slot.transform); bc.transform.localScale = new Vector3(1, 1, 1); bc.transform.localPosition = Vector3.zero; composants[i][j] = bc.GetComponent <BaseComponent>(); } } } //if (firstPopulate) { for (int i = 0; i < N; i++) { int j = 0; GameObject go = Pg.transform.GetChild((i) + (j) * (N)).gameObject; //the slot BaseComponent bc; if (go.transform.childCount > 1) { bc = go.transform.GetChild(1).GetComponent <BaseComponent>(); } else { bc = Instantiate(videFrontier); bc.transform.SetParent(go.transform); bc.transform.localScale = Vector3.one; bc.transform.localPosition = Vector3.zero; } //bc.transform.localRotation = Quaternion.Euler(0, 0, 0); bc.Rotate(); composants[i][j] = bc; (bc as BaseFrontier).GetValueFromSlot(); } for (int i = 0; i < N; i++) { int j = M - 1; GameObject go = Pg.transform.GetChild((i) + (j) * (N)).gameObject; //the slot BaseComponent bc; if (go.transform.childCount > 1) { bc = go.transform.GetChild(1).GetComponent <BaseComponent>(); } else { bc = Instantiate(videFrontier); bc.transform.SetParent(go.transform); bc.transform.localScale = Vector3.one; bc.transform.localPosition = Vector3.zero; } bc.Rotate(); //bc.transform.localRotation = Quaternion.Euler(0, 0, 0); composants[i][j] = bc; (bc as BaseFrontier).GetValueFromSlot(); } for (int j = 1; j < M - 1; j++) { int i = 0; GameObject go = Pg.transform.GetChild((i) + (j) * (N)).gameObject; //the slot BaseComponent bc; if (go.transform.childCount > 1) { bc = go.transform.GetChild(1).GetComponent <BaseComponent>(); } else { bc = Instantiate(videFrontier); bc.transform.SetParent(go.transform); bc.transform.localScale = Vector3.one; bc.transform.localPosition = Vector3.zero; } bc.Rotate(); //bc.transform.localRotation = Quaternion.Euler(0, 0, 0); composants[i][j] = bc; (bc as BaseFrontier).GetValueFromSlot(); } for (int j = 1; j < M - 1; j++) { int i = N - 1; GameObject go = Pg.transform.GetChild((i) + (j) * (N)).gameObject; //the slot BaseComponent bc; if (go.transform.childCount > 1) { bc = go.transform.GetChild(1).GetComponent <BaseComponent>(); } else { bc = Instantiate(videFrontier); bc.transform.SetParent(go.transform); bc.transform.localScale = Vector3.one; bc.transform.localPosition = Vector3.zero; } bc.Rotate(); //bc.transform.localRotation = Quaternion.Euler(0, 0, -0); composants[i][j] = bc; (bc as BaseFrontier).GetValueFromSlot(); } } StopperChanged = true; firstPopulate = false; }
private ListViewGroup GetGroupBaseDetail(BaseComponent baseComponent) { var bd = baseComponent.ToString(); return(new ListViewGroup(bd, bd)); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); serializedObject.Update(); BaseComponent t = (BaseComponent)target; EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode); { m_EditorResourceMode.boolValue = EditorGUILayout.BeginToggleGroup("Editor Resource Mode", m_EditorResourceMode.boolValue); { EditorGUILayout.HelpBox("Editor resource mode option is only for editor mode. Game Framework will use editor resource files, which you should validate first.", MessageType.Warning); EditorGUILayout.PropertyField(m_EditorLanguage); EditorGUILayout.HelpBox("Editor language option is only use for localization test in editor mode.", MessageType.Info); } EditorGUILayout.EndToggleGroup(); EditorGUILayout.BeginVertical("box"); { EditorGUILayout.LabelField("Global Helpers", EditorStyles.boldLabel); int versionHelperSelectedIndex = EditorGUILayout.Popup("Version Helper", m_VersionHelperTypeNameIndex, m_VersionHelperTypeNames); if (versionHelperSelectedIndex != m_VersionHelperTypeNameIndex) { m_VersionHelperTypeNameIndex = versionHelperSelectedIndex; m_VersionHelperTypeName.stringValue = (versionHelperSelectedIndex <= 0 ? null : m_VersionHelperTypeNames[versionHelperSelectedIndex]); } int logHelperSelectedIndex = EditorGUILayout.Popup("Log Helper", m_LogHelperTypeNameIndex, m_LogHelperTypeNames); if (logHelperSelectedIndex != m_LogHelperTypeNameIndex) { m_LogHelperTypeNameIndex = logHelperSelectedIndex; m_LogHelperTypeName.stringValue = (logHelperSelectedIndex <= 0 ? null : m_LogHelperTypeNames[logHelperSelectedIndex]); } int zipHelperSelectedIndex = EditorGUILayout.Popup("Zip Helper", m_ZipHelperTypeNameIndex, m_ZipHelperTypeNames); if (zipHelperSelectedIndex != m_ZipHelperTypeNameIndex) { m_ZipHelperTypeNameIndex = zipHelperSelectedIndex; m_ZipHelperTypeName.stringValue = (zipHelperSelectedIndex <= 0 ? null : m_ZipHelperTypeNames[zipHelperSelectedIndex]); } int jsonHelperSelectedIndex = EditorGUILayout.Popup("JSON Helper", m_JsonHelperTypeNameIndex, m_JsonHelperTypeNames); if (jsonHelperSelectedIndex != m_JsonHelperTypeNameIndex) { m_JsonHelperTypeNameIndex = jsonHelperSelectedIndex; m_JsonHelperTypeName.stringValue = (jsonHelperSelectedIndex <= 0 ? null : m_JsonHelperTypeNames[jsonHelperSelectedIndex]); } } EditorGUILayout.EndVertical(); } EditorGUI.EndDisabledGroup(); int frameRate = EditorGUILayout.IntSlider("Frame Rate", m_FrameRate.intValue, 1, 120); if (frameRate != m_FrameRate.intValue) { if (EditorApplication.isPlaying) { t.FrameRate = frameRate; } else { m_FrameRate.intValue = frameRate; } } EditorGUILayout.BeginVertical("box"); { float gameSpeed = EditorGUILayout.Slider("Game Speed", m_GameSpeed.floatValue, 0f, 8f); int selectedGameSpeed = GUILayout.SelectionGrid(GetSelectedGameSpeed(gameSpeed), GameSpeedTexts, 5); if (selectedGameSpeed >= 0) { gameSpeed = GetGameSpeed(selectedGameSpeed); } if (gameSpeed != m_GameSpeed.floatValue) { if (EditorApplication.isPlaying) { t.GameSpeed = gameSpeed; } else { m_GameSpeed.floatValue = gameSpeed; } } } EditorGUILayout.EndVertical(); bool runInBackground = EditorGUILayout.Toggle("Run in Background", m_RunInBackground.boolValue); if (runInBackground != m_RunInBackground.boolValue) { if (EditorApplication.isPlaying) { t.RunInBackground = runInBackground; } else { m_RunInBackground.boolValue = runInBackground; } } bool neverSleep = EditorGUILayout.Toggle("Never Sleep", m_NeverSleep.boolValue); if (neverSleep != m_NeverSleep.boolValue) { if (EditorApplication.isPlaying) { t.NeverSleep = neverSleep; } else { m_NeverSleep.boolValue = neverSleep; } } serializedObject.ApplyModifiedProperties(); }
public void ThenIHaveLoggedOutOfBBISFromTheFrontEnd() { BaseComponent.WaitClick("//a[text()='Logout']"); //check login is visible to confirm logout BaseComponent.GetEnabledElement("//a[text()='Login']"); }
public Promise(BaseComponent component) { component.OnDestroyed += OnDestroyed; component.OnAborted += OnAborted; Run(); }
public MjmlAttributesComponent(IElement element, BaseComponent parent, MjmlRootComponent documentRoot) : base(element, parent, documentRoot) { }
public PostTypeSearchDialog(BaseComponent parent) : base(parent) { }
public override void OnComponentAdded(BaseComponent c) { if (c is MatchComponent) { } }
/// <summary> /// Загрузить представление из потока. /// </summary> public override void LoadFromStream(Stream stream) { // очистка представления Clear(); SchemeDoc.SchemeView = this; // загрузка XML-документа XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(stream); // проверка формата файла (потока) XmlElement rootElem = xmlDoc.DocumentElement; if (!rootElem.Name.Equals("SchemeView", StringComparison.OrdinalIgnoreCase)) { throw new ScadaException(SchemePhrases.IncorrectFileFormat); } // получение смещений каналов при работе схемы в режиме шаблона int inCnlOffset = templateArgs.InCnlOffset; int ctrlCnlOffset = templateArgs.CtrlCnlOffset; // загрузка документа схемы if (rootElem.SelectSingleNode("Scheme") is XmlNode schemeNode) { SchemeDoc.LoadFromXml(schemeNode); // установка заголовка представления Title = SchemeDoc.Title; // добавление входных каналов представления foreach (int cnlNum in SchemeDoc.CnlFilter) { if (cnlNum > 0) { AddCnlNum(cnlNum + inCnlOffset); } } } // загрузка компонентов схемы if (rootElem.SelectSingleNode("Components") is XmlNode componentsNode) { HashSet <string> errNodeNames = new HashSet <string>(); // имена узлов незагруженных компонентов CompManager compManager = CompManager.GetInstance(); LoadErrors.AddRange(compManager.LoadErrors); foreach (XmlNode compNode in componentsNode.ChildNodes) { // создание компонента BaseComponent component = compManager.CreateComponent(compNode, out string errMsg); if (component == null) { component = new UnknownComponent { XmlNode = compNode }; if (errNodeNames.Add(compNode.Name)) { LoadErrors.Add(errMsg); } } // загрузка компонента и добавление его в представление component.SchemeView = this; component.LoadFromXml(compNode); Components[component.ID] = component; // добавление входных каналов представления if (component is IDynamicComponent dynamicComponent) { if (inCnlOffset > 0 && dynamicComponent.InCnlNum > 0) { dynamicComponent.InCnlNum += inCnlOffset; } if (ctrlCnlOffset > 0 && dynamicComponent.CtrlCnlNum > 0) { dynamicComponent.CtrlCnlNum += ctrlCnlOffset; } AddCnlNum(dynamicComponent.InCnlNum); AddCtrlCnlNum(dynamicComponent.CtrlCnlNum); } // определение макс. идентификатора компонентов if (component.ID > maxComponentID) { maxComponentID = component.ID; } } } // загрузка изображений схемы XmlNode imagesNode = rootElem.SelectSingleNode("Images"); if (imagesNode != null) { Dictionary <string, Image> images = SchemeDoc.Images; XmlNodeList imageNodes = imagesNode.SelectNodes("Image"); foreach (XmlNode imageNode in imageNodes) { Image image = new Image(); image.LoadFromXml(imageNode); if (!string.IsNullOrEmpty(image.Name)) { images[image.Name] = image; } } } }
public NationalInsuranceRatesSearchPage(BaseComponent parent) : base(parent) { }
private void OnComponentRemoved(FissureEntity entity, BaseComponent component) { ComponentRemoved?.Invoke(entity, component); }
public void DoAction() { createdComponent = Object.Instantiate(componentPrefab).GetComponent <BaseComponent>(); createdComponent.transform.position = componentPosition; createdComponent.name = createdComponent.name.Replace("(Clone)", ""); }
public void GivenIHaveLoggedOutOfBBCRM() { BaseComponent.WaitClick("//table[contains(@class,'x-btn bbui-pages-header-menubutton bbui-pages-header-usernamebutton x-btn-noicon')]//em[contains(@class,'x-btn-arrow x-unselectable')]"); BaseComponent.WaitClick("//span[text()='Log out']"); BaseComponent.GetEnabledElement("//div[@id='splash-content' ]"); }
public void Add(BaseComponent theComponent) { base.Add(theComponent); theComponent.Selected = true; }
public void GivenIHaveLoggedOutOfBBIS() { BaseComponent.WaitClick("//div[contains(@class,'bb_subMenuLogin')]//a[text()='Logout']"); BaseComponent.GetDisplayedElement("//div[contains(@id,'pnl_login')]"); }
private void OnDestroyed(BaseComponent component) { component.OnDestroyed -= OnDestroyed; Finish(); }
/// <summary> /// Initializes a new instance of the <see cref="ReportCardSearchResults"/> class. /// </summary> /// <param name="component">The component.</param> public ReportCardSearchResults(BaseComponent component) : base(component) { }
public MjmlRawComponent(IElement element, BaseComponent parent) : base(element, parent) { }
private void OnAborted(BaseComponent component) { component.OnAborted -= OnAborted; Abort(); }
/// <summary> /// Заполняет краткую информацию о директиве /// </summary> private void UpdateInformation() { if ((_currentDamageItem == null) || _currentDamageItem.ParentBaseComponent == null) { return; } var aircraft = GlobalObjects.AircraftsCore.GetParentAircraft(_currentDamageItem); //GlobalObjects.PerformanceCalculator.GetNextPerformance(_currentDamageItem); labelDirectiveValue.Text = _currentDamageItem.Title + " for"; labelDescriptionValue.Text = _currentDamageItem.Description; labelEffectiveDateValue.Text = Convert.GetDateFormat(_currentDamageItem.Threshold.EffectiveDate); labelSBValue.Text = _currentDamageItem.ServiceBulletinNo; labelEOValue.Text = _currentDamageItem.EngineeringOrders; labelATAChapterValue.Text = _currentDamageItem.ATAChapter.ToString(); labelApplicabilityValue.Text = ""; labelLocationValue.Text = _currentDamageItem.Location; labelDamageNumberValue.Text = _currentDamageItem.Number; labelSizeValue.Text = _currentDamageItem.Size; labelInspectionDocumentsValue.Text = _currentDamageItem.InspectionDocumentsNo; labelDamageTypeValue.Text = _currentDamageItem.DamageType.ToString(); linkDetailInfoFirst.Text = aircraft.ToString(); labelRemarksLast.Text = ""; labelIsTemporaryValue.Text = _currentDamageItem.IsTemporary ? "Yes" : "No"; if (CurrentAircraft != null) { linkDirectiveStatus.Text = BackLinkText; } if (_currentDamageItem.Remains != null && _currentDamageItem.Condition != ConditionState.NotEstimated) { if (_currentDamageItem.Remains.IsOverdue() && _currentDamageItem.Condition == ConditionState.Overdue) { labelRemains.Text = "Overdue:"; imageLinkLabelStatus.Status = Statuses.NotSatisfactory; } else if (_currentDamageItem.Condition == ConditionState.Notify) { labelRemains.Text = "Remains:"; imageLinkLabelStatus.Status = Statuses.Notify; } else if (_currentDamageItem.Condition == ConditionState.Satisfactory) { labelRemains.Text = "Remains:"; imageLinkLabelStatus.Status = Statuses.Satisfactory; } else { labelRemains.Text = "Remains:"; imageLinkLabelStatus.Status = Statuses.NotActive; } } imageLinkLabelStatus.Text = _currentDamageItem.WorkType.ToString(); labelRemainsValue.Text = ""; if (_currentDamageItem.Remains != null) { labelRemainsValue.Text = _currentDamageItem.Remains.ToString(); } labelCostValue.Text = _currentDamageItem.Cost.ToString(); labelManHoursValue.Text = _currentDamageItem.ManHours.ToString(); labelKitValue.Text = _currentDamageItem.KitRequired == "" ? "N" : _currentDamageItem.KitRequired; labelNDTvalue.Text = _currentDamageItem.NDTType.ShortName; labelRemarksValue.Text = _currentDamageItem.Remarks; labelHiddenRemarksValue.Text = ""; //if (_currentDamageItem.ADNoFileId <= 0) labelHiddenRemarksValue.Text = "No AD File."; //if (_currentDamageItem.ServiceBulletinFileId <= 0) // labelHiddenRemarksValue.Text += " No Service Bulletin File."; //if (_currentDamageItem.JobCard.FilePDF.ItemId <= 0) labelHiddenRemarksValue.Text += " No Job File."; if (labelHiddenRemarksValue.Text == "") { labelHiddenRemarksValue.Text = "No Important information"; // labelHiddenRemarks.Visible = false; } labelDateLast.Text = ""; labelAircraftTsnCsnLast.Text = ""; labelDateNext.Text = "n/a"; labelAircraftTsnCsnNext.Text = "n/a"; labelComponentTsnCsnNext.Text = "n/a"; labelRemarksValue.Text = ""; BaseComponent parentBaseComponent = _currentDamageItem.ParentBaseComponent; if (_currentDamageItem.LastPerformance != null) { labelDateLast.Text = Convert.GetDateFormat(_currentDamageItem.LastPerformance.RecordDate); //labelRemarksLast.Text = currentDirective.LastPerformance.Description; if (!_currentDamageItem.LastPerformance.OnLifelength.IsNullOrZero()) { labelComponentTsnCsnLast.Text = _currentDamageItem.LastPerformance.OnLifelength.ToString(); labelAircraftTsnCsnLast.Text = GlobalObjects.CasEnvironment.Calculator. GetFlightLifelengthOnEndOfDay(parentBaseComponent, _currentDamageItem.LastPerformance.RecordDate).ToString(); } } /////////////////////////////////////////////////////////////////////////////////////////////// labelFirstPerformanceValue.Text = "n/a"; labelRptIntervalValue.Text = "n/a"; if (_currentDamageItem.Threshold.FirstPerformanceSinceNew != null && !_currentDamageItem.Threshold.FirstPerformanceSinceNew.IsNullOrZero()) { labelFirstPerformanceValue.Text = "s/n: " + _currentDamageItem.Threshold.FirstPerformanceSinceNew; } if (_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate != null && !_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate.IsNullOrZero()) { if (labelFirstPerformanceValue.Text != "n/a") { labelFirstPerformanceValue.Text += " or "; } else { labelFirstPerformanceValue.Text = ""; } labelFirstPerformanceValue.Text += "s/e.d: " + _currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate; } if (_currentDamageItem.Threshold.RepeatInterval != null) { labelRptIntervalValue.Text = _currentDamageItem.Threshold.RepeatInterval.IsNullOrZero() ? "n/a" : _currentDamageItem.Threshold.RepeatInterval.ToString(); } //////////////////////////////////////////////////////////////////////////////////////////////// labelRemarksValue.Text = _currentDamageItem.Remarks; if (_currentDamageItem.IsClosed) { return; //если директива принудительно закрыта пользователем } //то вычисление следующего выполнения не нужно Lifelength temp; var tempAircraft = GlobalObjects.AircraftsCore.GetAircraftById(_currentDamageItem.ParentBaseComponent.ParentAircraftId);//TODO:(Evgenii Babak) пересмотреть использование ParentAircrafId здесь labelDateNext.Text = labelAircraftTsnCsnNext.Text = "n/a"; if (_currentDamageItem.LastPerformance == null) { if (_currentDamageItem.Threshold.FirstPerformanceSinceNew != null && !_currentDamageItem.Threshold.FirstPerformanceSinceNew.IsNullOrZero()) { //если наработка исчисляется с момента выпуска if (_currentDamageItem.Threshold.FirstPerformanceSinceNew.Days != null) { //если в первом выполнении заданы дни //то выводится точная дата следующего выполнения labelDateNext.Text = Convert.GetDateFormat( parentBaseComponent.ManufactureDate.AddDays( (double)_currentDamageItem.Threshold.FirstPerformanceSinceNew.Days)) + " s/n"; } else { //иначе, если (дополнительно) дата не определена labelDateNext.Text = "n/a"; } labelComponentTsnCsnNext.Text = "s/n: " + _currentDamageItem.Threshold.FirstPerformanceSinceNew; labelAircraftTsnCsnNext.Text = "s/n: " + _currentDamageItem.Threshold.FirstPerformanceSinceNew; //наработка на след выполнение больше той, что была при установке агрегата } if (_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate != null && !_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate.IsNullOrZero()) { //если наработка исчисляется с эффективной даты //Определение даты исполнения if (_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate.Days != null) { //если в первом выполнении заданы дни //то выводится точная дата следующего выполнения if (labelDateNext.Text != "n/a") { labelDateNext.Text += " or "; } else { labelDateNext.Text = ""; } labelDateNext.Text += Convert.GetDateFormat( _currentDamageItem.Threshold.EffectiveDate.AddDays ((double)_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate.Days)) + " s/e.d."; } else { //иначе, дату определить нельзя if (labelDateNext.Text == "") { labelDateNext.Text = "n/a"; } } //Определение наработки if (_currentDamageItem.Threshold.EffectiveDate < DateTime.Today) { Lifelength sinceEffDate = GlobalObjects.CasEnvironment.Calculator. GetFlightLifelengthOnEndOfDay(parentBaseComponent, _currentDamageItem.Threshold.EffectiveDate); sinceEffDate.Add(_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate); sinceEffDate.Resemble(_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate); if (labelComponentTsnCsnNext.Text != "n/a") { labelComponentTsnCsnNext.Text += " or "; } else { labelComponentTsnCsnNext.Text = ""; } labelComponentTsnCsnNext.Text += "s/e.d: " + sinceEffDate; //labelAircraftTsnCsnNext.Text = "s/n: " + _currentDamageItem.Threshold.FirstPerformanceSinceNew; if (labelAircraftTsnCsnNext.Text != "n/a") { labelAircraftTsnCsnNext.Text += " or "; } else { labelAircraftTsnCsnNext.Text = ""; } temp = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay((BaseEntityObject)tempAircraft, _currentDamageItem.Threshold.EffectiveDate); temp.Add(_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate); temp.Resemble(_currentDamageItem.Threshold.FirstPerformanceSinceEffectiveDate); labelAircraftTsnCsnNext.Text += "s/e.d: " + temp; } } } else { if (_currentDamageItem.Threshold.PerformRepeatedly && _currentDamageItem.Threshold.RepeatInterval != null) { //повторяющаяся директива //если есть последнне выполнение, то следующая дата расчитывается //по повторяющемуся интервалу if (_currentDamageItem.Threshold.RepeatInterval.Days != null) { //если в первом выполнении заданы дни //то выводится точная дата следующего выполнения labelDateNext.Text = Convert.GetDateFormat( _currentDamageItem.LastPerformance.RecordDate.AddDays( (double)_currentDamageItem.Threshold.RepeatInterval.Days)); } else { //иначе, точную дату выполнения расчитать нельзя labelDateNext.Text = "n/a"; labelComponentTsnCsnNext.Text = "n/a"; } //Определение наработки if (!_currentDamageItem.Threshold.RepeatInterval.IsNullOrZero()) { Lifelength nextTsnCsn; if (!_currentDamageItem.LastPerformance.OnLifelength.IsNullOrZero()) { nextTsnCsn = new Lifelength(_currentDamageItem.LastPerformance.OnLifelength); } else { nextTsnCsn = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(parentBaseComponent, _currentDamageItem. LastPerformance. RecordDate); } Lifelength nextAircraftTsnCsn = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay( parentBaseComponent, _currentDamageItem. LastPerformance. RecordDate); nextTsnCsn.Add(_currentDamageItem.Threshold.RepeatInterval); nextTsnCsn.Resemble(_currentDamageItem.Threshold.RepeatInterval); labelComponentTsnCsnNext.Text = nextTsnCsn.ToString(); nextAircraftTsnCsn.Add(_currentDamageItem.Threshold.RepeatInterval); nextAircraftTsnCsn.Resemble(_currentDamageItem.Threshold.RepeatInterval); labelAircraftTsnCsnNext.Text = nextAircraftTsnCsn.ToString(); if (labelComponentTsnCsnNext.Text == "") { labelComponentTsnCsnNext.Text = "n/a"; } if (labelAircraftTsnCsnNext.Text == "") { labelAircraftTsnCsnNext.Text = "n/a"; } } else { labelComponentTsnCsnNext.Text = "n/a"; } } } }
/// <summary> /// Производит дополнительную инициализацию /// </summary> private void Initialize() { _needReload = false; if (_currentComponent is BaseComponent) { _baseComponentHeaderControl = new BaseComponentHeaderControl(_currentComponent); _baseComponentHeaderControl.TabIndex = 0; flowLayoutPanelMain.Controls.Add(_baseComponentHeaderControl); flowLayoutPanelMain.Controls.SetChildIndex(_baseComponentHeaderControl, 0); } BaseComponent bd = _currentComponent as BaseComponent; if (bd == null || bd.BaseComponentType != BaseComponentType.Engine && bd.BaseComponentType != BaseComponentType.Apu) { extendableRichContainerWorkParams.Visible = false; } #region ButtonPrintContextMenu _buttonPrintMenuStrip = new ContextMenuStrip(); _itemPrintReportRecords = new ToolStripMenuItem { Text = "Commercial" }; _itemPrintReportEngineRecords = new ToolStripMenuItem { Text = "Records" }; _itemPrintReportHistory = new ToolStripMenuItem { Text = "Compliance history" }; _buttonPrintMenuStrip.Items.AddRange(new ToolStripItem[] { _itemPrintReportRecords, _itemPrintReportEngineRecords, _itemPrintReportHistory }); ButtonPrintMenuStrip = _buttonPrintMenuStrip; #endregion //обновление нижней шапки(через базовый скрин) if (_currentComponent.ParentBaseComponent != null) { var parentAircraft = GlobalObjects.AircraftsCore.GetAircraftById(_currentComponent.ParentBaseComponent.ParentAircraftId); var parentStore = GlobalObjects.StoreCore.GetStoreById(_currentComponent.ParentBaseComponent.ParentStoreId); if (parentAircraft != null) { CurrentAircraft = parentAircraft; } else if (parentStore != null) { CurrentStore = parentStore; } else if (_currentComponent.ParentOperator != null) { aircraftHeaderControl1.Operator = _currentComponent.ParentBaseComponent.ParentOperator;//TODO:(Evgenii Babak) заменить на использование OperatorCore } } else { var parentAircraft = GlobalObjects.AircraftsCore.GetAircraftById(_currentComponent.ParentAircraftId); var parentStore = GlobalObjects.StoreCore.GetStoreById(_currentComponent.ParentStoreId); if (parentAircraft != null) { CurrentAircraft = parentAircraft; } else if (parentStore != null) { CurrentStore = parentStore; } else if (_currentComponent.ParentOperator != null) { aircraftHeaderControl1.Operator = _currentComponent.ParentOperator; } else { aircraftHeaderControl1.Operator = GlobalObjects.CasEnvironment.Operators[0]; } //TODO:(Evgenii Babak) заменить на использование OperatorCore } //обновление суммарной информацию по директиве и суммарную информацию по её подзадачам StatusTitle = "Component Status"; if (_currentComponent.ItemId <= 0) { _summaryControl.Visible = false; _generalInformation.Visible = true; _performanceControl.Visible = true; } else { _summaryControl.Visible = true; _generalInformation.Visible = false; _performanceControl.Visible = false; } }
protected void btninterfload_Click(object sender, EventArgs e) { try { System.ServiceModel.WSHttpBinding binding = new System.ServiceModel.WSHttpBinding(System.ServiceModel.SecurityMode.None); binding.MaxReceivedMessageSize = int.MaxValue; string comtype = ddlcompanyname.SelectedValue; string bustype = ddlbusinesstype.SelectedValue; if (!string.IsNullOrEmpty(comtype) && !string.IsNullOrEmpty(bustype) && comtype.Contains(";")) { string[] comlist = comtype.Split(';'); string currentUserName = BaseWebPart.GetCurrentUserLoginId(); string dtcolstr = "目标客户公司代码,目标客户公司名称,目标客户说明,语义内容,业务代码,业务代码说明,业务翻译说明,目标客户代码,目标客户代码英文描述,目标客户代码中文描述,我方代码,我方代码英文描述,我方代码中文描述,生效时间,失效时间"; CBOSServices.CodSwicthTableServiceClient client = new CBOSServices.CodSwicthTableServiceClient(); CBOSServices.CodSwicthTable[] result = client.getCodSwitchMessage2(comlist[1], bustype); if (result != null && result.Length > 0) { codeMap.DelCodeMapByComIDAndBusID(comlist[1].Trim(), bustype.Trim());//插入前先删除 foreach (CBOSServices.CodSwicthTable re in result) { if (string.IsNullOrEmpty(re.CODE_CBOS)) { continue; } DataTable dt = new DataTable(); string[] dtitlelist = dtcolstr.Split(','); foreach (string str in dtitlelist) { dt.Columns.Add(str); } DataRow dr = dt.NewRow(); dr[0] = comlist[1]; dr[1] = comlist[0]; dr[2] = ""; dr[3] = ""; dr[4] = re.SWITCH_TAB_NAME; dr[5] = ""; dr[6] = ""; dr[7] = re.CODE_CBOS; dr[8] = re.CODE_NAME_E_CBOS; dr[9] = re.CODE_NAME_C_CBOS; dr[10] = re.CODE_SWITCH; dr[11] = re.CODE_NAME_E_SWITCH; dr[12] = re.CODE_NAME_C_SWITCH; dr[13] = ""; dr[14] = ""; dt.Rows.Add(dr); codeMap.InsertTableFromDataTable(dt, currentUserName); } } BindCodeMap(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "interfaceloadsuc", "InterfaceUploadSuccess();", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "interfaceloaderror", "layer.alert('公司名称与业务代码不能为空!',8);", true); } } catch (Exception ex) { BaseComponent.Error("代码映射接口导入: " + ex.Message + "--------" + ex.StackTrace); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "interfaceload", "layer.alert('接口导入出现异常,请联系管理员!',8);", true); } //finally //{ // //ddlcompanyname.SelectedValue = "all"; // //ddlbusinesstype.SelectedValue = "all"; //} }
public ServiceTermSearchPage(BaseComponent parent) : base(parent) { }
public override void OnComponentRemoved(BaseComponent c) { if (c is LossComponent) { } }
protected void CommunicationDetailList_ItemDataBound(object sender, RepeaterItemEventArgs e) { try { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DropDownList ddlTargetColumn = (DropDownList)e.Item.FindControl("ddlTargetColumn"); Literal lblTargetColumnName = (Literal)e.Item.FindControl("lblTargetColumnName"); Literal lblColumnDataType = (Literal)e.Item.FindControl("lblColumnDataType"); if (ddlTargetColumn != null && lblTargetColumnName != null) { string targetColumnName = lblTargetColumnName.Text; int index = 1; int selectIndex = 0; string selectedv = string.Empty; if (ViewState["TargetColumns"] != null) { DataTable dtTargetColumns = (DataTable)ViewState["TargetColumns"]; ddlTargetColumn.Items.Clear(); ddlTargetColumn.Items.Add(new ListItem("空", "")); foreach (DataRow row in dtTargetColumns.Rows) { string columnName = Convert.ToString(row["ColumnName"]); if (targetColumnName.Length > 0) { if (columnName.ToLower() == targetColumnName.ToLower()) { selectIndex = index; selectedv = columnName; } } string dataType = Convert.ToString(row["ColumnDataType"]); string dataTypeDisplayName = BaseComponent.GetLookupNameBuValue("BS_DATATYPE", dataType); if (dataTypeDisplayName.Length <= 0) { dataTypeDisplayName = dataType; } columnName += " - " + dataTypeDisplayName; if (!selectedv.Contains("-")) { selectedv += " - " + dataTypeDisplayName; } // ddlTargetColumn.Items.Add(new ListItem(columnName, dataTypeDisplayName)); ddlTargetColumn.Items.Add(new ListItem(columnName, columnName)); ++index; } ddlTargetColumn.SelectedValue = selectedv; //if (ddlTargetColumn.Items.Count > selectIndex) //{ // ddlTargetColumn.Items[selectIndex].Selected = true; //} } } Literal lblSourceDataType = (Literal)e.Item.FindControl("lblSourceDataType"); if (lblColumnDataType != null && lblSourceDataType != null && lblColumnDataType.Text.Length > 0) { string sourceDataType = BaseComponent.GetLookupNameBuValue("BS_DATATYPE", lblColumnDataType.Text); if (sourceDataType.Length <= 0) { sourceDataType = lblColumnDataType.Text; } ddlTargetColumn.Attributes.Add("onchange", "matchColumnDataType(this,'" + sourceDataType + "');"); lblSourceDataType.Text = sourceDataType; } } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alertException", "javascript:showMessage('操作发生错误:" + ex.Message.Replace("'", "").Replace("\"", "") + "!',8);", true); } }
public OfficerSearch(BaseComponent parent) : base(parent) { }
/// <summary> /// Производит перемещение заданных деталей на /// заданный склад или самолет и базовую делать на нем /// </summary> public void DoTransfer() { Aircraft destinationAircraft = (Aircraft)comboBoxAircraft.SelectedItem; BaseComponent destinationBaseComponent = (BaseComponent)comboBoxBaseComponent.SelectedItem; Store destinationStore = (Store)comboBoxStore.SelectedItem; int destinationSupplierId = 0; int destinationStaffId = 0; AttachedFile transferRecordAttachedFile = null; if (comboBoxSupplier.Enabled) { destinationSupplierId = ((Supplier)comboBoxSupplier.SelectedItem).ItemId; } else if (comboBoxStaff.Enabled) { destinationStaffId = ((Specialist)comboBoxStaff.SelectedItem).ItemId; } if (fileControl.GetChangeStatus()) { fileControl.ApplyChanges(); transferRecordAttachedFile = fileControl.AttachedFile; } DateTime transferDate = dateTimePickerDate.Value; DateTime receiptDate = ReceiptDatedateTimePicker.Value; var notify = NotifylifelengthViewer.Lifelength; var description = textBoxDescription.Text; var reason = comboBoxReason.SelectedItem as InitialReason; var released = comboBoxReleased.SelectedItem as Specialist; var received = comboBoxRecived.SelectedItem as Specialist; var remarks = textBoxRemarks.Text; var checkedItems = CheckedRows(); foreach (DataGridViewRow t in checkedItems) { var allCell = (DataGridViewNumericUpDownCell)t.Cells[2]; var replaceCell = (DataGridViewNumericUpDownCell)t.Cells[3]; var d = t.Tag as Component; if (d == null) { continue; } var all = Convert.ToDouble(allCell.Value); var replace = Convert.ToDouble(replaceCell.Value); if (radioButtonStore.Checked) { if (d is BaseComponent) { var baseComponent = d as BaseComponent; var baseComponentLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(baseComponent, transferDate); GlobalObjects.ComponentCore. MoveToStore(baseComponent, destinationStore, transferDate, baseComponentLlOnTransferDate, description, reason, released, received, _currentWorkPackage, transferRecordAttachedFile); } else { var replaced = replace >= 1 ? replace : 1; var beforeReplace = all >= 1 ? all : 1; Lifelength baseComponentLlOnTransferDate; if (beforeReplace != replaced) { baseComponentLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(new Component { Quantity = replaced }, transferDate); } else { baseComponentLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(d, transferDate); } GlobalObjects.ComponentCore.MoveToStore(d, destinationStore, transferDate, beforeReplace, replaced, baseComponentLlOnTransferDate, description, remarks, reason, released, received, _currentWorkPackage, transferRecordAttachedFile); } } else if (radioButtonAircraft.Checked) { if (d is BaseComponent) { var baseComponent = d as BaseComponent; var baseComponentLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(baseComponent, transferDate); GlobalObjects.ComponentCore. MoveToAircraft(baseComponent, destinationAircraft, transferDate, baseComponentLlOnTransferDate, description, reason, released, received, _currentWorkPackage, transferRecordAttachedFile); } else { var replaced = replace >= 1 ? replace : 1; var beforeReplace = all >= 1 ? all : 1; Lifelength baseDetailLlOnTransferDate; if (beforeReplace != replaced) { baseDetailLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(new Component { Quantity = replaced }, transferDate); } else { baseDetailLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(d, transferDate); } GlobalObjects.ComponentCore. MoveToAircraft(d, destinationBaseComponent, destinationAircraft, transferDate, beforeReplace, replaced, baseDetailLlOnTransferDate, description, reason, released, received, _currentWorkPackage, transferRecordAttachedFile); } } else if (radioButtonSupplier.Checked || radioButtonStaff.Checked) { if (d is BaseComponent) { //var baseComponent = d as BaseComponent; //var baseComponentLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(baseComponent, transferDate); //GlobalObjects.ComponentCore. // MoveToProcessing(baseComponent, destinationSupplier, transferDate, baseComponentLlOnTransferDate, description, reason, released, received, _currentWorkPackage, transferRecordAttachedFile); } else { var replaced = replace >= 1 ? replace : 1; var beforeReplace = all >= 1 ? all : 1; Lifelength baseComponentLlOnTransferDate; if (beforeReplace != replaced) { baseComponentLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(new Component { Quantity = replaced }, transferDate); } else { baseComponentLlOnTransferDate = GlobalObjects.CasEnvironment.Calculator.GetFlightLifelengthOnEndOfDay(d, transferDate); } GlobalObjects.ComponentCore.MoveToProcessing(d, destinationSupplierId, destinationStaffId, transferDate, beforeReplace, replaced, baseComponentLlOnTransferDate, description, remarks, reason, released, received, _currentWorkPackage, transferRecordAttachedFile, receiptDate, notify); } } else if (radioButtonStaff.Checked) { } } }
public override void ComponentInfo(out string[] names, out BaseComponent[] components) { names = new string[7]; components = new BaseComponent[7]; names [0] = Constants.COMBAT_STRING; components [0] = m_CombatComponent; names [1] = Constants.TARGETING_STRING; components [1] = m_TargetingComponent; names [2] = Constants.MOVEMENT_STRING; components [2] = m_MovementComponent; names [3] = Constants.CHARGE_MOVEMENT_STRING; components [3] = m_ChargeMovement; names [4] = Constants.BUILDING_CHARGE_STRING; components [4] = m_BuildingChargeMovement; names [5] = Constants.KNOCKED_BACK_MOVEMENT_STRING; components [5] = m_KnockedBackMovement; names [6] = Constants.HIT_BY_PLAYER_MOVEMENT_STRING; components [6] = m_HitByPlayerMovement; }
public GrabHandleW(BaseComponent theParent): base(theParent) { }
public void AddChild(BaseComponent component) { Children.Add(component); }
private static void CreateAndAddComponentBox(VCN3dsExporterPropertyEditorWindow referenceWindow, List<BaseComponent> components, StackPanel stack, BaseComponent component) { GroupBox grpBox = new GroupBox { Header = component.Name }; grpBox.BorderThickness = new Thickness(3); grpBox.BorderBrush = new SolidColorBrush(Color.FromRgb(0, 0, 0)); Dictionary<string, object> dict = component.GetAttributes(); StackPanel sp = new StackPanel(); grpBox.Content = sp; foreach (var item in dict) { StackPanel sp2 = new StackPanel(); sp2.Orientation = Orientation.Horizontal; Label lbl = new Label(); lbl.Content = item.Key; sp2.Children.Add(lbl); TextBox txt = new TextBox(); txt.Text = item.Value.ToString(); txt.TextChanged += (object sender, TextChangedEventArgs args) => { component.SetAttribute(item.Key, txt.Text); referenceWindow.SendDataUpdate(); }; sp2.Children.Add(txt); sp.Children.Add(sp2); } Button remove = new Button(); remove.Content = "Remove Component"; remove.Click += (object sender, RoutedEventArgs e) => { stack.Children.Remove(grpBox); components.Remove(component); referenceWindow.SendDataUpdate(); }; sp.Children.Add(remove); stack.Children.Add(grpBox); }
public void RemoveChild(BaseComponent component) { Children.Remove(component); }