public TestTaskItem(string msg) : this() { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), msg, new object[] { msg }); } _itemSpec = msg; }
void ICollection.CopyTo(Array array, int index) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "[{0}]={1}", new object[] { array, index }); } throw new NotImplementedException(); }
IDictionaryEnumerator IDictionary.GetEnumerator() { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod()); } return(new MyDictEnum(_map)); }
internal TestTaskItem() { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod()); } _map = new Dictionary <string, string>(); }
void ITaskItem.CopyMetadataTo(ITaskItem destinationItem) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "{0}={1}", new object[] { destinationItem }); } throw new NotImplementedException(); }
void ITaskItem.RemoveMetadata(string metadataName) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "{0}={1}", new object[] { metadataName }); } throw new NotImplementedException(); }
void IDictionary.Remove(object key) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "Key={0}", new object[] { key }); } throw new NotImplementedException(); }
void IDictionary.Clear() { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod()); } _map.Clear(); }
void IDictionary.Add(object key, object value) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "{0}={1}", new object[] { key, value }); } _map.Add(key.ToString(), value.ToString()); }
internal TestTaskItem(string key, string avalue) : this() { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "{0}={1}", new object[] { key, avalue }); } ((ITaskItem)this).ItemSpec = key; ((ITaskItem)this).SetMetadata(key, avalue); }
IDictionary ITaskItem.CloneCustomMetadata() { IDictionary ret; if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod()); } ret = new MyDictionary(_map); return(ret); }
void IEnumerator.Reset() { _nitems = _map.Count; _nindex = -1; if (verbose) { MiniLogger.log( MethodBase.GetCurrentMethod(), "ITEMS=" + _nitems + ", INDEX=" + _nindex); } }
bool IEnumerator.MoveNext() { bool ret; ret = _nitems < 0 ? false : (++_nindex < _nitems); if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "returning: " + ret + " [ITEMS=" + _nindex + ", INDEX=" + _nindex + "]"); } return(ret); }
public MyDictionary(IDictionary <string, string> amap) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod()); } if (amap != null) { foreach (string aKey in amap.Keys) { _map.Add(aKey, amap[aKey]); } } }
string ITaskItem.GetMetadata(string metadataName) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "{0}", new object[] { metadataName }); } string ret; ret = _map[metadataName]; if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "[" + metadataName + "] : " + ret); } return(_map[metadataName]); }
void ITaskItem.SetMetadata(string metadataName, string metadataValue) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "{0}={1}", new object[] { metadataName, metadataValue }); } if (_map.ContainsKey(metadataName)) { _map[metadataName] = metadataValue; } else { _map.Add(metadataName, metadataValue); } }
internal MyDictEnum(IDictionary <string, string> aMap) { if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod()); } _map = aMap; _keys = new List <string>(); if (_map != null) { foreach (string akey in _map.Keys) { _keys.Add(akey); } } if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "have " + _keys.Count + " keys."); } ((IDictionaryEnumerator)this).Reset(); }
object IDictionary.this[object key] { get { string akey = key.ToString(), ret; if (!_map.ContainsKey(akey)) { ret = null; } else { ret = _map[akey]; } if (verbose) { MiniLogger.log( MethodBase.GetCurrentMethod(), ": key=" + akey + " returning: " + (string.IsNullOrEmpty(ret) ? "NULL" : ret)); } return(ret); } set { string akey = key.ToString(); if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod(), "{0}={1}", new object[] { akey, value.ToString() }); } if (_map.ContainsKey(akey)) { _map[akey] = value.ToString(); } else { _map.Add(akey, value.ToString()); } } }
bool ITask.Execute() { string outFile, outSpecPath, dir = null; FileVersionInfo fvi; List <ITaskItem> content; if (verbose) { MiniLogger.log(MethodBase.GetCurrentMethod()); } if (string.IsNullOrEmpty(NuspecPath)) { showError("Property 'NuspecPath' is null!"); return(false); } outSpecPath = Path.GetDirectoryName(Path.GetFullPath(NuspecPath)); showMessage("NuspecPath=" + outSpecPath); try { dir = Path.GetDirectoryName(outSpecPath); showMessage("Check NuspecPath=" + dir); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); showMessage("Creating NuspecPath-dir =" + dir); } } catch (Exception ex) { showError("error creating directory '" + dir + "'" + Environment.NewLine + MiniLogger.decompose(ex)); return(false); } showMessage(MessageImportance.Low, "spec-path: " + outSpecPath); if (!string.IsNullOrEmpty(AssemblyPath)) { if (File.Exists(AssemblyPath)) { fvi = FileVersionInfo.GetVersionInfo(AssemblyPath); #if true outFile = Path.GetFullPath( Path.Combine( outSpecPath, Path.GetFileNameWithoutExtension(AssemblyPath) + ".nuspec")); #else outFile = Path.GetFullPath(Path.Combine( Path.GetDirectoryName(AssemblyPath), Path.GetFileNameWithoutExtension(AssemblyPath) + ".nuspec")); #endif showMessage("OUTFILE=" + outFile); if (generateSpecfile(outFile, fvi, AssemblyPath, out _pkg, out content)) { try { #if USE_TEST_TASK_ITEM _outputpath = new TestTaskItem(outFile); #else _outputpath = new TaskItem(outFile); #endif _result = true; populateData("NuspecData", content); } catch (ArgumentException ae) { showError(ae.Message); } catch (Exception ex) { showError(MiniLogger.decompose(ex)); } } Trace.WriteLine("here"); } else { this.showError(AssemblyPath + " does not exist in " + Directory.GetCurrentDirectory()); } } else { ((ITask)this).BuildEngine.LogErrorEvent( new BuildErrorEventArgs("subcat", "code", "file", -1, -1, -1, -1, "empty", "help", "sender", System.DateTime.Now)); } return(BuildResult); }
IEnumerator IEnumerable.GetEnumerator() { MiniLogger.log(MethodBase.GetCurrentMethod()); throw new NotImplementedException(); }