public static IDictionary <string, string> GetApplications() { ISSOMapper ssoMapper = (ISSOMapper) new SSOMapper(); AffiliateApplicationType affiliateApplicationType = AffiliateApplicationType.ConfigStore; IPropertyBag propertyBag = (IPropertyBag)ssoMapper; uint num = 1; object ptrVar1 = (object)(uint)affiliateApplicationType; object ptrVar2 = (object)num; propertyBag.Write("AppFilterFlags", ref ptrVar1); propertyBag.Write("AppFilterFlagMask", ref ptrVar2); string[] applications = (string[])null; string[] descriptions = (string[])null; string[] contactInfo = (string[])null; ssoMapper.GetApplications(out applications, out descriptions, out contactInfo); Dictionary <string, string> dictionary1 = new Dictionary <string, string>(applications.Length); Dictionary <string, string> dictionary2 = new Dictionary <string, string>(applications.Length); for (int index = 0; index < applications.Length; ++index) { if (applications[index].StartsWith("{")) { dictionary2.Add(applications[index], descriptions[index]); } else { dictionary1.Add(applications[index], descriptions[index]); } } foreach (string key in dictionary2.Keys) { dictionary1.Add(key, dictionary2[key]); } return((IDictionary <string, string>)dictionary1); }
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { string hidden = HiddenProperties(propertyBag, properties); propertyBag.Write("Namespaces", Namespaces.ToString()); propertyBag.Write("Properties", Properties.Serialize()); foreach (ContextValue context in Properties) { string name = context.ToString(); propertyBag.Write(name, context.Value); if (hidden != String.Empty && hidden.IndexOf(name) >= 0) { hidden = hidden.Replace(name, ""); } } hidden = hidden.Replace(",,", ","); propertyBag.Write("HiddenProperties", hidden); }
/// <summary> /// Save component properties to a property bag. /// </summary> /// <param name="propertyBag">Property bag</param> /// <param name="clearDirty">Clear dirty flag</param> /// <param name="saveAllProperties">Save all properties flag</param> public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { if (null == propertyBag) { throw new ArgumentNullException("propertyBag"); } object value = null; StringBuilder documentSpecNamesStringBuilder = new StringBuilder(); StringBuilder documentSpecNamespacesStringBuilder = new StringBuilder(); for (int c = 0; c < this.documentSchemaList.Count; ++c) { documentSpecNamesStringBuilder.Append(documentSchemaList[c].DocSpecName); documentSpecNamespacesStringBuilder.Append(documentSchemaList[c].TargetNamespace); if (c < this.documentSchemaList.Count - 1) { documentSpecNamesStringBuilder.Append(DocumentSpecNamesSeparator); documentSpecNamespacesStringBuilder.Append(DocumentSpecNamesSeparator); } } value = documentSpecNamesStringBuilder.ToString(); propertyBag.Write(DocumentSpecNamesPropertyName, ref value); value = documentSpecNamespacesStringBuilder.ToString(); propertyBag.Write(DocumentSpecNamespacesPropertyName, ref value); }
public static string[] GetCurrentUserApplications() { if (_applications == null) { ISSOMapper mapper = new ISSOMapper(); AffiliateApplicationType appTypes = AffiliateApplicationType.ConfigStore; IPropertyBag propBag = (IPropertyBag)mapper; uint appFilterFlagMask = SSOFlag.SSO_FLAG_APP_FILTER_BY_TYPE; uint appFilterFlags = (uint)appTypes; object appFilterFlagsObj = appFilterFlags; object appFilterFlagMaskObj = appFilterFlagMask; propBag.Write("AppFilterFlags", ref appFilterFlagsObj); propBag.Write("AppFilterFlagMask", ref appFilterFlagMaskObj); string[] descs; string[] contacts; mapper.GetApplications(out _applications, out descs, out contacts); } return(_applications); }
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { object val1 = (object)_password; object val2 = (object)_fileExtension; propertyBag.Write("Password", ref val1); propertyBag.Write("FileExtension", ref val2); }
/// <summary> /// Enlists the specified SSO object into the specified transaction. /// </summary> /// <remarks> /// The IPropertyBag interface is supported on the Single Sign-On objects: /// SSOAdmin, SSOMapper, SSOMapping, SSOLookup, SSOConfigStore. /// Note: /// This methods sets a DTC ITransaction pointer (as a VT_UNKNOWN) on the object model /// instance so that subsequent actions using that object are scoped within the DTC /// transaction. /// </remarks> /// <param name="ssoObj">Instance of the SSO object implementing the IPropertyBag interface to be enlisted.</param> /// <param name="tx">Transaction.</param> private static void Enlist(IPropertyBag ssoObj, Transaction tx) { object dtcTx = TransactionInterop.GetDtcTransaction(tx); object secretServerObj = SSOManager.SSOSecrectServer; ssoObj.Write("CurrentSSOServer", ref secretServerObj); ssoObj.Write("Transaction", ref dtcTx); }
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { object val = (object)this.PackagePath; propertyBag.Write(PackagePathPropertyName, ref val); val = (object)this.DataVariable; propertyBag.Write(DataVariablePropertyName, ref val); }
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { object Val1 = (object)_NodeName; object Val2 = (object)_UncFilepath; object Val3 = (object)_FileExtension; propertyBag.Write("NodeName", ref Val1); propertyBag.Write("UncFilepath", ref Val2); propertyBag.Write("FileExtension", ref Val3); }
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { object val; val = (object)FileExtension; propertyBag.Write("FileExtension", ref val); val = (object)Enabled; propertyBag.Write("Enabled", ref val); }
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { using (new DisposableObjectWrapper(new object[] { propertyBag })) { if (propertyBag == null) { throw new ArgumentNullException("propertyBag"); } object uri = this.AdapterConfiguration.Uri; propertyBag.Write("URI", ref uri); object config = this.AdapterConfiguration.Save(); propertyBag.Write("AdapterConfig", ref config); } }
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { object objVal = (object)_docSpecQN; propertyBag.Write("DocSpecQN", ref objVal); objVal = (object)_assemblyStrongName; propertyBag.Write("AssemblyStrongName", ref objVal); objVal = (object)_docSpecClassName; propertyBag.Write("DocSpecClassName", ref objVal); objVal = (object)MultiElementSchema; propertyBag.Write("MultiElementSchema", ref objVal); }
private IBaseComponent CreatePipelineComponent(XmlNode componentNode) { XmlNode node = componentNode.SelectSingleNode("Name"); if (node == null) { throw new InvalidOperationException("Component name node is not found"); } IBaseComponent component = this.CreatePipelineComponent(node.InnerText); IPropertyBag propertyBag = (IPropertyBag) new BTMPropertyBag(); foreach (XmlNode node2 in componentNode.SelectNodes("Properties/Property")) { if (node2.Attributes["Name"] == null) { throw new InvalidOperationException("Name attribute is not found for a property node"); } string innerText = node2.Attributes["Name"].InnerText; XmlNode valueNode = node2.SelectSingleNode("Value"); if (valueNode != null) { object typedPropertyValue = this.GetTypedPropertyValue(valueNode); propertyBag.Write(innerText, ref typedPropertyValue); } } ((IPersistPropertyBag)component).Load(propertyBag, 0); return(component); }
public int Save(IPropertyBag pPropBag, [In, MarshalAs(UnmanagedType.Bool)] bool fClearDirty, [In, MarshalAs(UnmanagedType.Bool)] bool fSaveAllProperties) { object stratExampleType = "Example3dNav"; int retval = pPropBag.Write("StratExampleType", ref stratExampleType); return(retval); }
public int WriteSolutionProps(IVsHierarchy pHierarchy, string pszKey, IPropertyBag pPropBag) { if (pHierarchy != null) { return(VSConstants.S_OK); // Not send by our code! } else if (pPropBag == null) { return(VSConstants.E_POINTER); } pPropBag.Write("spiraUrl", SpiraContext.BaseUri.ToString()); pPropBag.Write("spiraProjectId", SpiraContext.ProjectId.ToString()); return(VSConstants.S_OK); }
/// <summary> /// Returns a list of applications in the SSO store /// </summary> /// <returns>Application names</returns> public static List <string> GetApplications() { //get the app list: string[] applications = null; string[] descs; string[] contacts = null; try { var mapper = new ISSOMapper(); AffiliateApplicationType appTypes = AffiliateApplicationType.ConfigStore; appTypes |= AffiliateApplicationType.All; IPropertyBag propBag = (IPropertyBag)mapper; uint appFilterFlagMask = SSOFlag.SSO_FLAG_APP_FILTER_BY_TYPE; uint appFilterFlags = (uint)appTypes; object appFilterFlagsObj = (object)appFilterFlags; object appFilterFlagMaskObj = (object)appFilterFlagMask; propBag.Write("AppFilterFlags", ref appFilterFlagsObj); propBag.Write("AppFilterFlagMask", ref appFilterFlagMaskObj); mapper.GetApplications(out applications, out descs, out contacts); } catch (COMException comEx) { HandleCOMException(comEx, 0); } List <string> apps = new List <string>(); if (contacts != null) { for (int i = 0; i < applications.Length; i++) { if (string.Equals(contacts[i], ApplicationManager.ContactInfo)) { apps.Add(applications[i]); } } } return(apps); }
/// <summary> /// Gets the list of SSO applications. Only the application metadata information is returned. /// </summary> /// <returns>List of SSO applications.</returns> public static List <SSOAppInfo> GetApplications() { ISSOMapper2 ssoMapper = new ISSOMapper2(); IPropertyBag propBag = ssoMapper as IPropertyBag; // prepare filter to only include config store application uint appFilterFlagMask = SSOFlag.SSO_FLAG_APP_FILTER_BY_TYPE; uint appFilterFlags = (uint)AffiliateApplicationType.ConfigStore; object appFilterFlagsObj = (object)appFilterFlags; object appFilterFlagMaskObj = (object)appFilterFlagMask; // set filter in the mapper propBag.Write("AppFilterFlags", ref appFilterFlagsObj); propBag.Write("AppFilterFlagMask", ref appFilterFlagMaskObj); // declare output arrays string[] applications = null; string[] descriptions = null; string[] contactInfo = null; string[] userAccounts = null; string[] adminAccounts = null; int[] flags = null; // get applications ssoMapper.GetApplications2(out applications, out descriptions, out contactInfo, out userAccounts, out adminAccounts, out flags); List <SSOAppInfo> applicationList = new List <SSOAppInfo>(); for (int index = 0; index < applications.Length; ++index) { // include only applications created by this tool if (SSOManager.DefaultContact.Equals(contactInfo[index], StringComparison.InvariantCultureIgnoreCase) == true) { SSOAppInfo appInfo = new SSOAppInfo() { Name = applications[index], Description = descriptions[index], AdminAccounts = adminAccounts[index], UserAccounts = userAccounts[index], Contact = contactInfo[index], Flags = flags[index], }; applicationList.Add(appInfo); } } return(applicationList); }
public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { if (this.MessageNamespace != null) { object messageNamespace = this.MessageNamespace; propertyBag.Write("MessageNamespace", ref messageNamespace); } }
public int WriteSolutionProps([InAttribute] IVsHierarchy pHierarchy, [InAttribute] string pszKey, [InAttribute] IPropertyBag pPropBag) { pPropBag.WriteBool(_strUseSSL, settings.UseSSL); pPropBag.WriteBool(_strUseIFD, settings.UseIFD); pPropBag.WriteBool(_strUseOnline, settings.UseOnline); pPropBag.WriteBool(_strUseOffice365, settings.UseOffice365); pPropBag.WriteBool(_strUseOffice365, settings.UseOffice365); pPropBag.Write(_strServerName, settings.ServerName); pPropBag.Write(_strServerPort, settings.ServerPort); pPropBag.Write(_strHomeRealm, settings.HomeRealm); //pPropBag.Write(_strCrmUrl, settings.CrmSdkUrl); pPropBag.Write(_strDomain, settings.Domain); pPropBag.Write(_strUseWindowsAuth, settings.UseWindowsAuth.ToString()); //pPropBag.Write(_strUsername, settings.Username); //pPropBag.Write(_strPassword, settings.Password); pPropBag.Write(_strOrganization, settings.CrmOrg); pPropBag.Write(_strIncludeEntities, settings.EntitiesToIncludeString); pPropBag.WriteBool(_strIncludeNonStandard, settings.IncludeNonStandard); settings.Dirty = false; return(VSConstants.S_OK); }
void IPersistPropertyBag.Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { object valTempFolder = (object)TempFolder; propertyBag.Write("TempFolder", ref valTempFolder); object valTargetFolder = (object)TargetFolder; propertyBag.Write("TargetFolder", ref valTargetFolder); object valFieldDelimiter = (object)FieldDelimiter; propertyBag.Write("FieldDelimiter", ref valFieldDelimiter); object valNameSpace = (object)NameSpace; propertyBag.Write("NameSpace", ref valNameSpace); }
void IPersistPropertyBag.Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { object val = (object)this.PipelineToExecute; if (propertyBag != null) { propertyBag.Write(PROP_PipelineToExecute, ref val); } }
/// <summary> /// Saves the property. /// </summary> /// <typeparam name="TProperty">The type of the property.</typeparam> /// <param name="propertyBag">The property bag.</param> /// <param name="propertyExpression">The property expression.</param> protected virtual void SaveProperty <TProperty>(IPropertyBag propertyBag, Expression <Func <T, TProperty> > propertyExpression) { Guard.NotNull(propertyBag, "propertyBag"); Guard.NotNull(propertyExpression, "propertyExpression"); object propValue = propertyExpression.Compile()((T)this); string propName = ((MemberExpression)propertyExpression.Body).Member.Name; propertyBag.Write(propName, ref propValue); }
private static void WritePropertyBag(IPropertyBag propertyBag, string propertyName, object itemValue) { try { propertyBag.Write(propertyName, ref itemValue); } catch (Exception ex) { throw new ApplicationException(ex.Message); } }
public static void WritePropertyBag(IPropertyBag propertyBag, string propName, object val) { try { propertyBag.Write(propName, ref val); } catch (Exception ex) { throw new Exception("Error while writing to the propery bag", ex); } }
public int WriteSolutionProps(IVsHierarchy pHierarchy, string pszKey, IPropertyBag pPropBag) { ThreadHelper.ThrowIfNotOnUIThread(); if (pHierarchy == null) { pPropBag.Write("PropertyName", "PropertyValue"); } return(VSConstants.S_OK); }
public int WriteSolutionProps([In] IVsHierarchy pHierarchy, [In] string pszKey, [In] IPropertyBag pPropBag) { if (_usingSolutionOptions) { string value = _solutionConfigurationPath .Substring(Path.GetDirectoryName(_dte2.Solution.FullName).Length) .TrimStart(DirectorySeparators); pPropBag.Write(SolutionConfigurationLocationProperty, value); } return(VSConstants.S_OK); }
/// <summary> /// Writes property values into a property bag. /// </summary> /// <param name="pb">Property bag.</param> /// <param name="propName">Name of property.</param> /// <param name="val">Value of property.</param> public static void WritePropertyBag(IPropertyBag pb, string propName, object val) { try { pb.Write(propName, ref val); } catch (Exception e) { throw new ApplicationException(e.Message); } }
/// <summary> /// Writes property values into a property bag. /// </summary> /// <param name="pb">Property bag.</param> /// <param name="propName">Name of property.</param> /// <param name="val">Value of property.</param> private void WritePropertyBag(IPropertyBag pb, string propName, object val) { try { pb.Write(propName, ref val); } catch (System.Exception e) { throw new System.ApplicationException(e.Message); } }
/// <summary> /// Writes property values into a property bag. /// </summary> /// <param name="pb">Property bag.</param> /// <param name="propName">Name of property.</param> /// <param name="val">Value of property.</param> private void WritePropertyBag(IPropertyBag propertyBag, string propertyName, object value) { try { propertyBag.Write(propertyName, ref value); } catch (Exception ex) { //ExceptionHelper.HandleException(Resources.T4TemplaterPipelineComponentName, ex); //TraceHelper.WriteLineIf(traceEnabled, ex.Message, EventLogEntryType.Error); throw;; } }
private static void WritePropertyBag(IPropertyBag propertyBag , string propertyName, object val) { // Writes property values into a property bag. try { propertyBag.Write(propertyName, ref val); } catch (Exception ex) { throw new ApplicationException(ex.Message); } }
/// <summary> /// Disable DirectX Video Acceleration. /// </summary> /// <param name="fgm"></param> public static void DisableDXVA(FilgraphManagerClass fgm) { // Retrieve WM decoder so we can turn off DXVA IBaseFilter decoder = Filter.FindBaseFilterByName(fgm, "WMVideo Decoder DMO"); if (decoder == null) { return; } // Remove the renderer and everything back to the decoder IFilterGraph iFG = (IFilterGraph)fgm; IEnumFilters iEnum; iFG.EnumFilters(out iEnum); uint fetched; IBaseFilter iBF; iEnum.Next(1, out iBF, out fetched); List <IBaseFilter> toRemove = new List <IBaseFilter>(); /// A base assumption is that the first items returned by the enumerator /// are the video renderer and other filters upstream to the video decoder. /// This should be true if these filters were the most recently added. /// Otherwise it would break in some contexts, including that of graphs with multiple branches. while (fetched == 1 && (Filter.Name(iBF) != Filter.Name(decoder))) { toRemove.Add(iBF); iEnum.Next(1, out iBF, out fetched); } foreach (IBaseFilter ibf in toRemove) { iFG.RemoveFilter(ibf); } // Try turning off DXVA try { IPropertyBag iPB = (IPropertyBag)decoder; object o = false; iPB.Write(WM9PropList.g_wszWMVCDXVAEnabled, ref o); } catch (Exception e) { Console.WriteLine(e.ToString()); } // Might be WM7 instead of WM9 // Render again ((IGraphBuilder)fgm).Render(Filter.GetPin(decoder, _PinDirection.PINDIR_OUTPUT, Guid.Empty, Guid.Empty, false, 0)); }
/// <summary> /// Writes property values into a property bag. /// </summary> /// <param name="pb">Property bag.</param> /// <param name="propName">Name of property.</param> /// <param name="val">Value of property.</param> private void WritePropertyBag(IPropertyBag propertyBag, string propertyName, object value) { try { propertyBag.Write(propertyName, ref value); } catch (Exception ex) { //ExceptionHelper.HandleException(Resources.T4TemplaterPipelineComponentName, ex); //TraceHelper.WriteLineIf(traceEnabled, ex.Message, EventLogEntryType.Error); throw; ; } }
private void WriteInfo(DatabaseInfo info, IPropertyBag pBag) { var reference = new DatabaseInfo(info.Name); object val; if (reference.ConnectionString != info.ConnectionString && info.ConnectionString != null) { val = info.ConnectionString; pBag.Write(info.Name + ".ConnectionString", ref val); } if (reference.SqlScriptsPath != info.SqlScriptsPath && info.SqlScriptsPath != null) { val = info.SqlScriptsPath; pBag.Write(info.Name + ".SqlScriptsPath", ref val); } if (reference.ConfirmUnsafe != info.ConfirmUnsafe) { val = info.ConfirmUnsafe.ToString(); pBag.Write(info.Name + ".ConfirmUnsafe", ref val); } if (reference.DiffBefore != info.DiffBefore) { val = info.DiffBefore.ToString(); pBag.Write(info.Name + ".DiffBefore", ref val); } if (reference.ApplyMigration != info.ApplyMigration) { val = info.ApplyMigration.ToString(); pBag.Write(info.Name + ".ApplyMigration", ref val); } if (reference.VarraySize != info.VarraySize && info.VarraySize != null) { val = info.VarraySize; pBag.Write(info.Name + ".VarraySize", ref val); } if (reference.GrantRole != info.GrantRole && info.GrantRole != null) { val = info.GrantRole; pBag.Write(info.Name + ".GrantRole", ref val); } if (reference.CompileMigration != info.CompileMigration) { val = info.CompileMigration.ToString(); pBag.Write(info.Name + ".CompileMigration", ref val); } }
private void WriteInfo(LibraryInfo info, IPropertyBag pBag) { var reference = new LibraryInfo(info.Type, null, null); object val; if (reference.CompileOption != info.CompileOption) { val = info.CompileOption.ToString(); pBag.Write(info.Type + ".Compile", ref val); } if (reference.Name != info.Name) { val = info.Name; pBag.Write(info.Type + ".Name", ref val); } if (reference.Target != info.Target) { val = info.Target; pBag.Write(info.Type + ".Target", ref val); } if (reference.Dependencies != info.Dependencies) { val = info.Dependencies; pBag.Write(info.Type + ".Dependencies", ref val); } if (reference.Namespace != info.Namespace) { val = info.Namespace; pBag.Write(info.Type + ".Namespace", ref val); } if (reference.WithActiveRecord != info.WithActiveRecord) { val = info.WithActiveRecord.ToString(); pBag.Write(info.Type + ".ActiveRecord", ref val); } if (reference.WithHelperMethods != info.WithHelperMethods) { val = info.WithHelperMethods.ToString(); pBag.Write(info.Type + ".HelperMethods", ref val); } if (reference.WithManualJson != info.WithManualJson) { val = info.WithManualJson.ToString(); pBag.Write(info.Type + ".WithManualJson", ref val); } if (reference.UseUtc != info.UseUtc) { val = info.UseUtc.ToString(); pBag.Write(info.Type + ".UseUtc", ref val); } if (reference.Legacy != info.Legacy) { val = info.Legacy.ToString(); pBag.Write(info.Type + ".Legacy", ref val); } if (reference.MinimalSerialization != info.MinimalSerialization) { val = info.MinimalSerialization.ToString(); pBag.Write(info.Type + ".MinimalSerialization", ref val); } if (reference.NoPrepareExecute != info.NoPrepareExecute) { val = info.NoPrepareExecute.ToString(); pBag.Write(info.Type + ".NoPrepareExecute", ref val); } }
/// <summary> /// Writes property values into a property bag. /// </summary> /// <param name="propertyBag">Property bag.</param> /// <param name="propertyName">Name of property.</param> /// <param name="value">Value of property.</param> protected static void WritePropertyBag(IPropertyBag propertyBag, string propertyName, object value) { propertyBag.Write(propertyName, ref value); }