/// <summary> /// Creates a new instance of view NameValuePair. /// </summary> /// <returns>an instance of <see cref="Framework.NameValuePair"/></returns> public static Framework.NameValuePair CreateNameValuePair( System.String name, System.String value ) { Framework.NameValuePair _retval = new Framework.NameValuePair(); _retval.Name = name; _retval.Value = value; return(_retval); }
/// <summary> /// Initializes a new instance of the ViewModelBuildLog class. /// </summary> public WPCommonOfBuildLogVM() { this.RefreshNewItem(); this.EntityCollectionDefault = new ObservableCollection <MSBuildLogsExtended.DataSourceEntities.BuildLog.Default>(); #region Commands for Cascading ComboBox this.GetDropDownContentsOfBuildEventCode_1Command = new RelayCommand(this.GetDropDownContentsOfBuildEventCode_1); this.GetDropDownContentsOfSolution_1Command = new RelayCommand(this.GetDropDownContentsOfSolution_1); #if NETFX_CORE this.GetDropDownContentsOfSolution_1SelectionChangedCommand = new RelayCommand <Windows.UI.Xaml.Controls.SelectionChangedEventArgs>( (e) => { if (e.AddedItems.Count > 0) { Framework.NameValuePair item = (Framework.NameValuePair)e.AddedItems[0]; this.GetDropDownContentsOfBuild_1(item); } }); #else this.GetDropDownContentsOfSolution_1SelectionChangedCommand = new RelayCommand <System.Windows.Controls.SelectionChangedEventArgs>( (e) => { if (e.AddedItems.Count > 0) { Framework.NameValuePair item = (Framework.NameValuePair)e.AddedItems[0]; this.GetDropDownContentsOfBuild_1(item); } }); #endif #endregion Commands for Cascading ComboBox ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real": Connect to service, etc... ////} }
public void GetDropDownContentsOfBuild_1(Framework.NameValuePair input) { MSBuildLogsExtended.DataSourceEntities.SolutionIdentifier parentIdentifier = MSBuildLogsExtended.EntityContracts.ISolutionIdentifierHelper.Create <MSBuildLogsExtended.DataSourceEntities.SolutionIdentifier>(input.Value); MSBuildLogsExtended.WcfContracts.IBuildServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceBuild(); AsyncCallback asyncCallback = delegate(IAsyncResult result) { try { #if WINDOWS_PHONE DispatcherHelper.Initialize(); #endif DispatcherHelper.CheckBeginInvokeOnUI((Action) delegate() { var responseMessage = _Instance.EndGetCollectionOfNameValuePairOfByFKOnly(result); Framework.NameValueCollection collection = responseMessage.Message; this.DropDownContentsOfBuild_1.Clear(); if (collection != null) { foreach (Framework.NameValuePair item in collection) { this.DropDownContentsOfBuild_1.Add(item); } } }); } catch (Exception ex) { } }; try { MSBuildLogsExtended.CommonBLLEntities.BuildRequestMessageUserDefinedOfByFKOnly _Request = new MSBuildLogsExtended.CommonBLLEntities.BuildRequestMessageUserDefinedOfByFKOnly() { Critieria = new MSBuildLogsExtended.CommonBLLEntities.BuildChainedQueryCriteriaByFKOnly(true, parentIdentifier.Id), QueryPagingSetting = new Framework.EntityContracts.QueryPagingSetting(-1, -1), QueryOrderBySettingCollection = new Framework.EntityContracts.QueryOrderBySettingCollection(null), BusinessLogicLayerRequestID = Guid.NewGuid().ToString(), BusinessLogicLayerRequestTypes = Framework.CommonBLLEntities.BusinessLogicLayerRequestTypes.Search, }; _Instance.BeginGetCollectionOfNameValuePairOfByFKOnly(_Request, asyncCallback, null); } catch (Exception ex) { } }
public void GetDropDownContentsOfOrganization_1(Framework.NameValuePair <System.Int64> input) { try { if (input != null) { var client = new MSBuildExtensionPack.WebApiClient.OrganizationApiControllerClient(MSBuildExtensionPack.MVVMLightViewModels.ViewModelLocator.WebApiRootUrl); var result = Task.Run(() => client.GetCollectionOfNameValuePairOfByFKOnlyAsync(true, input.Value, -1, -1, null)).Result; var dispatcherHelper = Framework.Xaml.IDispatcherHelperWrapperService.GetDispatcherHelper(); dispatcherHelper.CheckBeginInvokeOnUI((Action) delegate() { this.DropDownContentsOfOrganization_1.Clear(); if (result != null) { foreach (var item in result) { if (item != null) { System.Int64 value = item.ParseToSystemInt64(null); this.DropDownContentsOfOrganization_1.Add(new Framework.NameValuePair <System.Int64>(value, item.Name)); } } } }); } else { this.DropDownContentsOfOrganization_1.Clear(); } RaisePropertyChanged(PropertyName_DropDownContentsOfOrganization_1); } catch (Exception ex) { Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName_Static, PropertyName_DropDownContentsOfOrganization_1, Framework.UIAction.Search, Framework.UIActionStatus.Failed, ex.Message)); } }
/// <summary> /// Builds the name value pair. /// </summary> /// <typeparam name="T">type name inherit from <see cref="IBuildLog"/></typeparam> /// <param name="input">The input.</param> /// <returns>a new instance of <see cref="Framework.NameValuePair"/></returns> public static Framework.NameValuePair BuildNameValuePair <T>(T input) where T : IBuildLog, IBuildLogIdentifier, new() { Framework.NameValuePair _retval = new Framework.NameValuePair(input.Id, BuildNameOfNameValuePair <T>(input)); return(_retval); }
/// <summary> /// Creates a new instance of view NameValuePair. /// </summary> /// <returns>an instance of <see cref="Framework.NameValuePair"/></returns> public static Framework.NameValuePair CreateNameValuePair( System.String name, System.String value ) { Framework.NameValuePair _retval = new Framework.NameValuePair(); _retval.Name = name; _retval.Value = value; return _retval; }