/// <summary> /// Removes the counters, then calls the base uninstall. /// </summary> /// <param name="savedState">The saved state for the installation.</param> public override void Uninstall(System.Collections.IDictionary savedState) { ConsoleHarness.WriteToConsole(ConsoleColor.White, "Un-Installing service {0}.", Configuration.Name); // load the assembly file name and the config ConfigureInstallers(); base.Uninstall(savedState); // wire up the event log source, if provided if (!string.IsNullOrWhiteSpace(Configuration.EventLogSource)) { // create the source if it doesn't exist if (EventLog.SourceExists(Configuration.EventLogSource)) { EventLog.DeleteEventSource(Configuration.EventLogSource); } } }
public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); stateSaver.Add("TargetDir", Context.Parameters["assemblypath"].ToString().Replace("InstallerClassDLL.dll", "")); SerialNumber _SerialNumber = new SerialNumber("Install", Context, stateSaver); DialogResult dr = _SerialNumber.ShowDialog(); if (dr == DialogResult.Cancel) { _SerialNumber.Dispose(); throw new InstallException("Installation is cancelled!"); } else { _SerialNumber.Dispose(); } }
/// <summary> /// Installer class, to use run InstallUtil against this .exe /// </summary> /// <param name="savedState">The saved state for the installation.</param> public override void Install(System.Collections.IDictionary savedState) { ConsoleHarness.WriteToConsole(ConsoleColor.White, "Installing service {0}.", Configuration.Name); // install the service ConfigureInstallers(); base.Install(savedState); // wire up the event log source, if provided if (!string.IsNullOrWhiteSpace(Configuration.EventLogSource)) { // create the source if it doesn't exist if (!EventLog.SourceExists(Configuration.EventLogSource)) { EventLog.CreateEventSource(Configuration.EventLogSource, "Application"); } } }
static bool Hashtable_Hashtable4(JSVCall vc, int argc) { int _this = JSApi.getObject((int)JSApi.GetType.Arg); JSApi.attachFinalizerObject(_this); --argc; int len = argc; if (len == 2) { System.Collections.IDictionary arg0 = (System.Collections.IDictionary)JSMgr.datax.getObject((int)JSApi.GetType.Arg); System.Single arg1 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg); JSMgr.addJSCSRel(_this, new System.Collections.Hashtable(arg0, arg1)); } return(true); }
public static bool Save(JSONObject h, string path) { var s = Encode(h); if (File.Exists(path)) { var oldS = File.ReadAllText(path, Encoding.GetEncoding(0)); if (s.Equals(oldS)) { return(false); } } var bytes = Encoding.UTF8.GetBytes(s); File.WriteAllBytes(path, bytes); return(true); }
public override void Install(System.Collections.IDictionary stateSaver) { //2 August 2019: The next 4 lines were added in Take 10 in order prevent double loading of packages. Microsoft.Win32.RegistryKey rkbase = null; rkbase = Microsoft.Win32.RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64); rkbase.CreateSubKey("SOFTWARE\\Wow6432Node\\Default Company Name\\CSharp PLAYPEN II Google 'Josh API Revit'", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("XceedVersion", typeof(Xceed.Wpf.Toolkit.PropertyGrid.PropertyGrid).Assembly.FullName); rkbase.CreateSubKey("SOFTWARE\\Wow6432Node\\Default Company Name\\CSharp PLAYPEN II Google 'Josh API Revit'", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree).SetValue("OokiiVersion", typeof(Ookii.Dialogs.Wpf.CredentialDialog).Assembly.FullName); //2 August 2019: End. string sDir = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Autodesk\\Revit\\Addins"; bool exists = System.IO.Directory.Exists(sDir); if (!exists) { System.IO.Directory.CreateDirectory(sDir); } XElement XElementAddIn = new XElement("AddIn", new XAttribute("Type", "Application")); XElementAddIn.Add(new XElement("Name", myAddinDLL)); XElementAddIn.Add(new XElement("Assembly", this.Context.Parameters["targetdir"].Trim() + myAddinDLL + ".dll")); // /TargetDir=value1 / XElementAddIn.Add(new XElement("AddInId", Guid.NewGuid().ToString())); //DatabaseMethods.writeDebug(Guid.NewGuid().ToString()); XElementAddIn.Add(new XElement("FullClassName", myAddinDLL + ".ThisApplication")); XElementAddIn.Add(new XElement("VendorId", "01")); XElementAddIn.Add(new XElement("VendorDescription", "Joshua Lumley Secrets, twitter @joshnewzealand")); XElement XElementRevitAddIns = new XElement("RevitAddIns"); XElementRevitAddIns.Add(XElementAddIn); try { foreach (string d in Directory.GetDirectories(sDir)) { //DirSearch.Add(d); new XDocument(XElementRevitAddIns).Save(d + "\\" + myAddinDLL + ".addin"); //files.AddRange(DirSearch.Add(d)); } } catch (System.Exception excpt) { System.Windows.Forms.MessageBox.Show(excpt.Message); } }
private IDictionary <TKey, TValue> ResolveLeafDictionary(Func <int, TKey> keyAccessor, bool createIfNeeded) { System.Collections.IDictionary result = _root; for (int i = 0; i < Depth - 1; i++) { var parent = result; var key = keyAccessor(i); result = (System.Collections.IDictionary)parent[key]; if (result == null) { if (!createIfNeeded) { return(null); } parent[key] = result = CreateInternalDictionary(i + 1); } } return((IDictionary <TKey, TValue>)result); }
protected override void OnBeforeUninstall(System.Collections.IDictionary savedState) { base.OnBeforeUninstall(savedState); if (savedState.Contains(ArrayKey)) { string[] files = savedState[ArrayKey] as string[]; if (files != null) { foreach (string file in files) { try { File.Delete(file); } catch { } } } } }
//========================================================================================= // //========================================================================================= public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); try { string assembly = this.GetType().Assembly.Location; string applicationId = null; string typeLib = null; RegistrationHelper registrationHelper = new RegistrationHelper(); registrationHelper.InstallAssembly(assembly, ref applicationId, ref typeLib, InstallationFlags.FindOrCreateTargetApplication); } catch (Exception e) { throw e; } }
public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); string commonAppDataFolder = Context.Parameters["codecomappdatafolder"]; string targetAssemblyFolder = Context.Parameters["codetargetdir"]; if (commonAppDataFolder != null && targetAssemblyFolder != null) { commonAppDataFolder = commonAppDataFolder.Trim(); targetAssemblyFolder = targetAssemblyFolder.Trim(); targetAssemblyFolder = targetAssemblyFolder.Replace(@"\\", @"\"); //find the AddIn file(s) just created, and customize them to point to the correct folder for the assembly FixAddInFileIfExists(targetAssemblyFolder, commonAppDataFolder + @"\Microsoft\SQL Server Management Studio\11.0\Addins\PoorMansTSqlFormatterSSMSAddIn.AddIn", "Microsoft SQL Server Management Studio"); FixAddInFileIfExists(targetAssemblyFolder, commonAppDataFolder + @"\Microsoft\VisualStudio\8.0\Addins\PoorMansTSqlFormatterSSMSAddIn.AddIn", "Microsoft Visual Studio"); FixAddInFileIfExists(targetAssemblyFolder, commonAppDataFolder + @"\Microsoft\VisualStudio\9.0\Addins\PoorMansTSqlFormatterSSMSAddIn.AddIn", "Microsoft Visual Studio"); FixAddInFileIfExists(targetAssemblyFolder, commonAppDataFolder + @"\Microsoft\VisualStudio\10.0\Addins\PoorMansTSqlFormatterSSMSAddIn.AddIn", "Microsoft Visual Studio"); FixAddInFileIfExists(targetAssemblyFolder, commonAppDataFolder + @"\Microsoft\VisualStudio\11.0\Addins\PoorMansTSqlFormatterSSMSAddIn.AddIn", "Microsoft Visual Studio"); } }
private void GetPlayerVC_Success(string json, object cb) { /* * "data" : { * "updatedAt" : 1392919197588, * "currencyMap" : { * "gold" : { * "purchased" : 0, * "balance" : 10, * "consumed" : 0, * "awarded" : 10 * } * } */ m_mainScene.AddLog("SUCCESS"); m_mainScene.AddLogJson(json); m_mainScene.AddLog(""); JsonData jObj = JsonMapper.ToObject(json); JsonData jCurMap = jObj ["data"] ["currencyMap"]; System.Collections.IDictionary dCurMap = jCurMap as System.Collections.IDictionary; foreach (string key in dCurMap.Keys) { Currency c = null; if (m_currencies.ContainsKey(key)) { c = m_currencies[key]; } else { c = new Currency(); m_currencies[key] = c; } c.currencyType = key; c.purchased = (int)jCurMap[key]["purchased"]; c.balance = (int)jCurMap[key]["balance"]; c.consumed = (int)jCurMap[key]["consumed"]; c.awarded = (int)jCurMap[key]["awarded"]; } }
public int Insert_SystemSet(Type type, System.Collections.IDictionary param, string database = null) { try { if (param == null) { param = new Hashtable(); } param["database"] = database; return(dataMapper.Update(String.Format("{0}.Insert_SystemSet", GetMapName(type)), param)); } catch (DataMapperException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public IList <ShopSelectModel> QueryShopSelectModels(Type type, System.Collections.IDictionary param, string database = null) { try { if (param == null) { param = new Hashtable(); } param["database"] = database; return(dataMapper.QueryForList <ShopSelectModel>(String.Format("{0}.QueryShopSelectModels", GetMapName(type)), param)); } catch (DataMapperException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public Query_Pay_Total GysHomeTotal(Type type, System.Collections.IDictionary param, string database = null) { try { if (param == null) { param = new Hashtable(); } param["database"] = database; return(dataMapper.QueryForObject <Query_Pay_Total>(String.Format("{0}.GysHomeTotal", GetMapName(type)), param)); } catch (DataMapperException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public Ts_Log QueryItem(Type type, System.Collections.IDictionary param, string database = null) { try { if (param == null) { param = new Hashtable(); } param["database"] = database; return(dataMapper.QueryForObject <Ts_Log>(String.Format("{0}.QueryItem", GetMapName(type)), param)); } catch (DataMapperException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public IList <Td_Sale_Order_Head_Query> QueryPageOfService(Type type, System.Collections.IDictionary param, string database = null) { try { if (param == null) { param = new Hashtable(); } param["database"] = database; return(dataMapper.QueryForList <Td_Sale_Order_Head_Query>(String.Format("{0}.QueryPageOfService", GetMapName(type)), param)); } catch (DataMapperException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public Td_Report QueryOrderStatisticsInfo(Type type, System.Collections.IDictionary param, string database = null) { try { if (param == null) { param = new Hashtable(); } param["database"] = database; return(dataMapper.QueryForObject <Td_Report>(String.Format("{0}.QueryOrderStatisticsInfo", GetMapName(type)), param)); } catch (DataMapperException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public override void Uninstall(System.Collections.IDictionary savedState) { int uninstallStep = 0; try { base.Uninstall(savedState); uninstallStep++; if (EventLog.SourceExists(sSource)) { uninstallStep++; EventLog.DeleteEventSource(sSource); } uninstallStep++; } catch (Exception ex) { System.Windows.MessageBox.Show("Error performing uninstaller task: " + ex.Message + ", at step " + uninstallStep); } }
public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); ServiceController controller = new ServiceController("CompPlan CL Service"); try { controller.Start(); } catch (Exception ex) { String source = "CompPlan CL Service"; String log = "Application"; if (!EventLog.SourceExists(source)) { EventLog.CreateEventSource(source, log); } EventLog eLog = new EventLog(); eLog.Source = source; eLog.WriteEntry(@"The service could not be started. Please start the service manually. Error: " + ex.Message, EventLogEntryType.Error); } }
public IList <T> QueryListByStatementName <T>(Type type, System.Collections.IDictionary param, string statementName = "QueryList", string database = null) { try { if (param == null) { param = new Hashtable(); } param["database"] = database; return(dataMapper.QueryForList <T>(String.Format("{0}.{1}", GetMapName(type), statementName), param)); } catch (DataMapperException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public override object CreateInstance(ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { if (propertyValues == null) { throw new ArgumentNullException("propertyValues"); } T ret = default(T); object boxed = ret; foreach (DictionaryEntry entry in propertyValues) { PropertyInfo pi = ret.GetType().GetProperty(entry.Key.ToString()); if (pi != null && pi.CanWrite) { pi.SetValue(boxed, Convert.ChangeType(entry.Value, pi.PropertyType), null); } } return((T)boxed); }
public IList <Td_Report> QueryReportbyMonthPage(Type type, System.Collections.IDictionary param, string database = null) { try { if (param == null) { param = new Hashtable(); } param["database"] = database; return(dataMapper.QueryForList <Td_Report>(String.Format("{0}.QueryReportbyMonthPage", GetMapName(type)), param)); } catch (DataMapperException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public override void Install(System.Collections.IDictionary stateSaver) { try { string path = this.Context.Parameters["targetdir"];//安装目录 if (!path.EndsWith("\\")) { path = path + "\\"; } string aimFilePath = string.Format("{0}FMMonitorService\\FileManager.MonitoringTool.exe", path); if (File.Exists(aimFilePath)) { if (!ProcessStart(aimFilePath)) { //MessageBox.Show("程序启动异常!"); MessageBox.Show("程序自动启动失败,请重启计算!"); } } else { //MessageBox.Show(aimFilePath); //MessageBox.Show("目录不存在!"); } //MessageBox.Show("开始删除快捷房事 !"); // 设置文件夹的权限 SetFolderAuth(path); // 删除快捷方式 DelChem32Link(); base.Install(stateSaver); } catch (Exception ex) { //MessageBox.Show("程序异常!" + ex.Message + ex.StackTrace); MessageBox.Show("程序自动启动失败,请重启计算!"); } }
//public override void Uninstall(System.Collections.IDictionary savedState) protected override void OnBeforeUninstall(System.Collections.IDictionary savedState) { base.OnBeforeUninstall(savedState); string regasmPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + @"regasm.exe"; if (System.Environment.Is64BitOperatingSystem) //to prevent wow6432 issue { regasmPath = regasmPath.Replace("Framework", "Framework64"); } string componentPath = typeof(Installer1).Assembly.Location; //MessageBox.Show(regasmPath + "\"" + componentPath + "\"" + " /codebase"); System.Diagnostics.ProcessStartInfo processInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe"); processInfo.Verb = "runas"; processInfo.Arguments = "/K " + regasmPath + " /unregister \"" + componentPath + "\"" + " /codebase"; //System.Diagnostics.Process.Start(processInfo); System.Diagnostics.Process.Start(regasmPath, "\"" + componentPath + "\"" + " /codebase /unregister"); System.Threading.Thread.Sleep(1000); }
protected static T GetOption <T>(SC.IDictionary options, string name, T defVal) { if (options == null || !options.Contains(name)) { return(defVal); } object v = options[name]; if (typeof(T).IsAssignableFrom(v.GetType())) { return((T)v); } if (typeof(T).IsEnum) { return((T)Enum.Parse(typeof(T), Convert.ToString(v), true)); } else { return((T)Convert.ChangeType(v, typeof(T))); } }
public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); string targetDirectory = Context.Parameters["targetdir"]; string strConfigFilename = "ADOpt-V4.exe.config"; try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(targetDirectory + strConfigFilename); foreach (XmlElement element in xmlDoc.DocumentElement) { if (element.Name.Equals("oracle.dataaccess.client")) { //For Each xElement As XmlElement In XmlDoc.DocumentElement foreach (XmlNode node in element.ChildNodes) { if (node.ChildNodes[0].Attributes[0].Value.Equals("DllPath")) { node.ChildNodes[0].Attributes[1].Value = targetDirectory + "Data_Display_Oracle_Connection\\bin"; } } } } xmlDoc.Save(targetDirectory + strConfigFilename); //System.Configuration.ConfigurationManager.RefreshSection("oracle.dataaccess.client"); } catch (Exception ex) { throw ex; } }
public override void Commit(System.Collections.IDictionary savedState) { base.Commit(savedState); #if NO // 创建事件日志目录 if (!EventLog.SourceExists("dp2Capo")) { EventLog.CreateEventSource("dp2Capo", "DigitalPlatform"); } EventLog Log = new EventLog(); Log.Source = "dp2Capo"; Log.WriteEntry("dp2Capo 安装成功。", EventLogEntryType.Information); #endif // 2016/11/12 ServiceUtil.SetRecoveryOptions(this.serviceInstaller1.ServiceName); EventLog.WriteEntry(this.serviceInstaller1.ServiceName, "dp2Capo 安装成功。", EventLogEntryType.Information); }
protected override void PostFilterProperties(System.Collections.IDictionary properties) { // Hide the Anchor property so it cannot be changed by the developer at design time. PropertyDescriptor dockDescriptor = (PropertyDescriptor)properties["Dock"]; dockDescriptor = TypeDescriptor.CreateProperty(dockDescriptor.ComponentType, dockDescriptor, new Attribute[] { new BrowsableAttribute(false), new EditorBrowsableAttribute(EditorBrowsableState.Never) }); properties[dockDescriptor.Name] = dockDescriptor; // Hide the AutoScroll property so it cannot be changed by the developer at design time // because it is set from the nearest panel of type scrollable control. PropertyDescriptor autoScrollDescriptor = (PropertyDescriptor)properties["AutoScroll"]; autoScrollDescriptor = TypeDescriptor.CreateProperty(autoScrollDescriptor.ComponentType, autoScrollDescriptor, new Attribute[] { new ReadOnlyAttribute(true) }); properties[autoScrollDescriptor.Name] = autoScrollDescriptor; // Make the Name property read only so it cannot be changed by the developer at design time // because it is set from the nearest panel of type scrollable control. PropertyDescriptor nameDescriptor = (PropertyDescriptor)properties["Name"]; nameDescriptor = TypeDescriptor.CreateProperty(nameDescriptor.ComponentType, nameDescriptor, new Attribute[] { new ReadOnlyAttribute(true) }); properties[nameDescriptor.Name] = nameDescriptor; // Always call the base method last. base.PostFilterProperties(properties); }
protected void options(SC.IDictionary options) { if (_curFlow != null) { _curFlow.IsCancelling = GetOption(options, "cancelling", _curFlow.IsCancelling); _curFlow.Label = GetOption(options, "label", _curFlow.Label); _curFlow.SourcePortType = GetOption(options, "sourcePort", _curFlow.SourcePortType); _curFlow.TargetPortType = GetOption(options, "targetPort", _curFlow.TargetPortType); _curFlow.EvalOrder = GetOption(options, "evalOrder", _curFlow.EvalOrder); } else if (_curVar != null) { _curVar.IsRequired = GetOption(options, required, _curVar.IsRequired); _curVar.IsArray = GetOption(options, isArray, _curVar.IsArray); _curVar.VariableDir = GetOption(options, dir, _curVar.VariableDir); _curVar.DefaultValueExpr = GetOption(options, "defaultValue", _curVar.DefaultValueExpr); } else { throw new Exception(); } }
public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); string commonAppDataFolder = Context.Parameters["codecomappdatafolder"]; string targetAssemblyFolder = Context.Parameters["codetargetdir"]; if (commonAppDataFolder != null && targetAssemblyFolder != null) { //find the AddIn file just created, and customize it to point to the correct folder for the assembly string addInFilePath = commonAppDataFolder + @"\Microsoft\SQL Server Management Studio\11.0\Addins\PoorMansTSqlFormatterSSMSAddIn.AddIn"; XmlNameTable nt = new NameTable(); XmlNamespaceManager ns = new XmlNamespaceManager(nt); ns.AddNamespace("autoext", "http://schemas.microsoft.com/AutomationExtensibility"); XmlDocument addInDefinitionFile = new XmlDocument(); addInDefinitionFile.Load(addInFilePath); XmlNode customizableNode = addInDefinitionFile.SelectSingleNode("/autoext:Extensibility/autoext:Addin/autoext:Assembly", ns); customizableNode.InnerText = customizableNode.InnerText.Replace("%TARGETDIR%", targetAssemblyFolder); addInDefinitionFile.Save(addInFilePath); } }
private void Load() { m_buffers = new System.Collections.Generic.Dictionary<object, object>(); using (IRepository rep = ServiceProvider.GetService<IRepositoryFactory>().GenerateRepository(m_persistentClass)) { rep.BeginTransaction(); IList list = rep.List(m_persistentClass); rep.CommitTransaction(); foreach (object i in list) { object id = EntityScript.GetPropertyValue(i, ServiceProvider.GetService<IEntityMetadataGenerator>().GenerateEntityMetadata(m_persistentClass).IdName); m_buffers[id] = i; } } }
/// <summary> /// 清空 /// </summary> public void Clear() { if (m_buffers != null) { m_buffers.Clear(); m_buffers = null; } }
public ProofStep(Rule rule, System.Collections.IDictionary substitutions) { Rule = rule; Substitutions = substitutions; }
protected internal virtual void Init() { programs = new Hashtable(); programs[DEFAULT_PROGRAM_NAME] = new ArrayList(PROGRAM_INIT_SIZE); lastRewriteTokenIndexes = new Hashtable(); }
public void InitParam(IDictionary ht) { htKeyValue = ht; }
public PayPaymentOrdersForm() { this.InitializeComponent(); this.reestersPaymentOrderDict = new System.Collections.Hashtable(); this.searchForm = new PayPaymentOrderSearchForm(); }
internal DictionaryTraceRecord(System.Collections.IDictionary dictionary) { this.dictionary = dictionary; }