コード例 #1
0
        public NumberBehavior(XmlElement configuration)
            : base(configuration)
        {
            projectName = GetParameter("HansoftProject");
            viewType = GetViewType(GetParameter("View"));
            columnName = GetParameter("ColumnName");
            string styleValue = GetParameter("NumberingStyle");
            if (styleValue.Trim().Equals("Hierarchical"))
                hierarchical = true;
            string labelValue = GetParameter("LabelLevels");
            if (!labelValue.Equals(string.Empty))
            {
                lOptionFound = true;
                foreach (string lv in labelValue.Split(new char[] { ',' }))
                    labelLevels.Add(Int32.Parse(lv));
            }
            string ignoreValue = GetParameter("IgnoreLevels");
            if (!ignoreValue.Equals(string.Empty))
            {
                iOptionFound = true;
                foreach (string iv in ignoreValue.Split(new char[] { ',' }))
                    ignoreLevels.Add(Int32.Parse(iv));
            }

            if (iOptionFound)
                explicitIgnoreLevels = BuildLevelArray(ignoreLevels);
            if (lOptionFound)
                explicitLabelLevels = BuildLevelArray(labelLevels);
            title = "NumberBehavior: " + configuration.InnerText;
        }
コード例 #2
0
 /// <summary>
 /// Factory method for creating a Task (subclass of).
 /// </summary>
 /// <param name="uniqueID">The Task ID or TaskRef ID that a Task shuld be created for</param>
 /// <param name="viewType">The view that the task appears in (primarily  important for product backlog items which can appear in mutiple views).</param>
 /// <returns>A concrete task acting as a wrapper to access the Hansoft API for the task in question.</returns>
 internal static Task GetTask(HPMUniqueID uniqueID, EHPMReportViewType viewType)
 {
     if ((viewType == EHPMReportViewType.ScheduleMainProject || viewType == EHPMReportViewType.AgileMainProject) && SdkSession.UtilIsIDTask(uniqueID) && SdkSession.UtilIsIDBacklogProject(SdkSession.TaskGetContainer(uniqueID)))
         return GetTask(SdkSession.TaskGetProxy(uniqueID));
     else
         return GetTask(uniqueID);
 }
 public DefaultValueBehavior(XmlElement configuration)
     : base(configuration)
 {
     projectName    = GetParameter("HansoftProject");
     columnDefaults = GetColumnDefaults(configuration);
     viewType       = GetViewType(GetParameter("View"));
     title          = "DefaultValueBehavior: " + configuration.InnerText;
 }
 public DefaultValueBehavior(XmlElement configuration)
     : base(configuration)
 {
     projectName = GetParameter("HansoftProject");
     columnDefaults = GetColumnDefaults(configuration);
     viewType = GetViewType(GetParameter("View"));
     title = "DefaultValueBehavior: " + configuration.InnerText;
 }
コード例 #5
0
 public TypeColorBehavior(XmlElement configuration)
     : base(configuration)
 {
     projectName = GetParameter("HansoftProject");
     string invert = GetParameter("InvertedMatch");
     if (invert != null)
         inverted = invert.ToLower().Equals("yes");
     viewName = GetParameter("View");
     viewType = GetViewType(viewName);
     title = "TypeColorBehavior: " + configuration.InnerText;
 }
コード例 #6
0
 /// <summary>
 /// Factory method for creating a Task (subclass of).
 /// </summary>
 /// <param name="uniqueID">The Task ID or TaskRef ID that a Task shuld be created for</param>
 /// <param name="viewType">The view that the task appears in (primarily  important for product backlog items which can appear in mutiple views).</param>
 /// <returns>A concrete task acting as a wrapper to access the Hansoft API for the task in question.</returns>
 internal static Task GetTask(HPMUniqueID uniqueID, EHPMReportViewType viewType)
 {
     if ((viewType == EHPMReportViewType.ScheduleMainProject || viewType == EHPMReportViewType.AgileMainProject) && SdkSession.UtilIsIDTask(uniqueID) && SdkSession.UtilIsIDBacklogProject(SdkSession.TaskGetContainer(uniqueID)))
     {
         return(GetTask(SdkSession.TaskGetProxy(uniqueID)));
     }
     else
     {
         return(GetTask(uniqueID));
     }
 }
 public AggregateMilestoneBehavior(XmlElement configuration)
     : base(configuration)
 {
     projectName = GetParameter("HansoftProject");
     viewName = GetParameter("View");
     viewType = GetViewType(viewName);
     string invert = GetParameter("InvertedMatch");
     if (invert != null)
         inverted = invert.ToLower().Equals("yes");
     find = GetParameter("Find");
 }
コード例 #8
0
 public DeriveBehavior(XmlElement configuration)
     : base(configuration)
 {
     projectName = GetParameter("HansoftProject");
     string invert = GetParameter("InvertedMatch");
     if (invert != null)
         inverted = invert.ToLower().Equals("yes");
     viewType = GetViewType(GetParameter("View"));
     find = GetParameter("Find");
     derivedColumns = GetDerivedColumns(configuration);
     title = "DeriveBehavior: " + configuration.InnerText;
 }
コード例 #9
0
        internal List <Task> Find(string findString, EHPMReportViewType viewType)
        {
            List <Task>        found       = new List <Task>();
            HPMFindContext     findContext = new HPMFindContext();
            HPMFindContextData data        = SessionManager.Session.UtilPrepareFindContext(findString, UniqueID, viewType, findContext);
            HPMTaskEnum        items       = SessionManager.Session.TaskFind(data, EHPMTaskFindFlag.None);

            foreach (HPMUniqueID taskID in items.m_Tasks)
            {
                found.Add(Task.GetTask(taskID, viewType));
            }
            return(found);
        }
コード例 #10
0
        public DeriveBehavior(XmlElement configuration)
            : base(configuration)
        {
            projectName = GetParameter("HansoftProject");
            string invert = GetParameter("InvertedMatch");

            if (invert != null)
            {
                inverted = invert.ToLower().Equals("yes");
            }
            viewType       = GetViewType(GetParameter("View"));
            find           = GetParameter("Find");
            derivedColumns = GetDerivedColumns(configuration);
            title          = "DeriveBehavior: " + configuration.InnerText;
        }
コード例 #11
0
        public TrackLastStatusChangeBehavior(XmlElement configuration)
            : base(configuration)
        {
            projectName = GetParameter("HansoftProject");
            string invert = GetParameter("InvertedMatch");

            if (invert != null)
            {
                inverted = invert.ToLower().Equals("yes");
            }
            trackingColumnName = GetParameter("TrackingColumn");
            trackedColumnName  = GetParameter("TrackedColumn");
            viewName           = GetParameter("View");
            viewType           = GetViewType(viewName);
            title = "TrackLastStatusChangeBehavior: " + configuration.InnerText;
        }
コード例 #12
0
        public NumberBehavior(XmlElement configuration) : base(configuration)
        {
            projectName = GetParameter("HansoftProject");
            viewType    = GetViewType(GetParameter("View"));
            columnName  = GetParameter("ColumnName");
            string styleValue = GetParameter("NumberingStyle");

            if (styleValue.Trim().Equals("Hierarchical"))
            {
                hierarchical = true;
            }
            string labelValue = GetParameter("LabelLevels");

            if (!labelValue.Equals(string.Empty))
            {
                lOptionFound = true;
                foreach (string lv in labelValue.Split(new char[] { ',' }))
                {
                    labelLevels.Add(Int32.Parse(lv));
                }
            }
            string ignoreValue = GetParameter("IgnoreLevels");

            if (!ignoreValue.Equals(string.Empty))
            {
                iOptionFound = true;
                foreach (string iv in ignoreValue.Split(new char[] { ',' }))
                {
                    ignoreLevels.Add(Int32.Parse(iv));
                }
            }

            if (iOptionFound)
            {
                explicitIgnoreLevels = BuildLevelArray(ignoreLevels);
            }
            if (lOptionFound)
            {
                explicitLabelLevels = BuildLevelArray(labelLevels);
            }
            title = "NumberBehavior: " + configuration.InnerText;
        }
コード例 #13
0
        public CopyBehavior(XmlElement configuration)
            : base(configuration)
        {
            targetProjectName = GetParameter("TargetProject");
            targetView = GetParameter("TargetView");
            targetViewType = GetViewType(targetView);
            targetFind = GetParameter("TargetFind");
            sourceProjectName = GetParameter("SourceProject");
            sourceView = GetParameter("SourceView");
            sourceViewType = GetViewType(sourceView);
            sourceFind = GetParameter("SourceFind");
            columnMappings = new List<ColumnMapping>();

            foreach (XmlElement cEl in configuration.GetElementsByTagName("ColumnMapping"))
            {
                ColumnMapping columnMapping = new ColumnMapping();
                columnMapping.SourceColumn = GetColumnDefinition(cEl, "Source");
                columnMapping.TargetColumn = GetColumnDefinition(cEl, "Target");
                columnMappings.Add(columnMapping);
            }
            title = "CopyBehavior: " + configuration.InnerText;
        }
コード例 #14
0
        public CopyBehavior(XmlElement configuration)
            : base(configuration)
        {
            targetProjectName = GetParameter("TargetProject");
            targetView        = GetParameter("TargetView");
            targetViewType    = GetViewType(targetView);
            targetFind        = GetParameter("TargetFind");
            sourceProjectName = GetParameter("SourceProject");
            sourceView        = GetParameter("SourceView");
            sourceViewType    = GetViewType(sourceView);
            sourceFind        = GetParameter("SourceFind");
            columnMappings    = new List <ColumnMapping>();

            foreach (XmlElement cEl in configuration.GetElementsByTagName("ColumnMapping"))
            {
                ColumnMapping columnMapping = new ColumnMapping();
                columnMapping.SourceColumn = GetColumnDefinition(cEl, "Source");
                columnMapping.TargetColumn = GetColumnDefinition(cEl, "Target");
                columnMappings.Add(columnMapping);
            }
            title = "CopyBehavior: " + configuration.InnerText;
        }
コード例 #15
0
ファイル: HansoftExport.cs プロジェクト: persu/HansoftExport
 static bool ParseArguments(string[] args)
 {
     bool cOptionFound = false;
     bool pOptionFound = false;
     bool rOptionFound = false;
     bool fOptionFound = false;
     bool oOptionFound = false;
     foreach (string optionString in args)
     {
         string option = optionString.Substring(0, 2);
         string[] pars = optionString.Substring(2).Split(new char[] { ':' });
         for (int i = 0; i < pars.Length; i += 1)
         {
             if (pars[i].StartsWith("\"") && pars[i].EndsWith("\""))
                 pars[i] = pars[i].Substring(1, pars[i].Length - 2);
         }
         switch (option)
         {
             case "-c":
                 if (cOptionFound)
                     throw new ArgumentException("The -c option can only be specified once");
                 if (pars.Length != 5)
                     throw new ArgumentException("The -c option was not specified correctly");
                 cOptionFound = true;
                 server = pars[0];
                 portNumber = Int32.Parse(pars[1]);
                 databaseName = pars[2];
                 sdkUser = pars[3];
                 sdkUserPwd = pars[4];
                 break;
             case "-p":
                 if (pOptionFound)
                     throw new ArgumentException("The -p option can only be specified once");
                 if (pars.Length != 2)
                     throw new ArgumentException("The -p option was not specified correctly");
                 pOptionFound = true;
                 projectName = pars[0];
                 switch (pars[1])
                 {
                     case "a":
                         viewType = EHPMReportViewType.AgileMainProject;
                         break;
                     case "s":
                         viewType = EHPMReportViewType.ScheduleMainProject;
                         break;
                     case "b":
                         viewType = EHPMReportViewType.AgileBacklog;
                         break;
                     case "q":
                         viewType = EHPMReportViewType.AllBugsInProject;
                         break;
                     default:
                         throw new ArgumentException("An unsupported view type was specified, valid values are one of [a|s|b|q]");
                 }
                 break;
             case "-r":
                 if (rOptionFound || fOptionFound)
                     throw new ArgumentException("Either the -r option or the -f option can only be specified once");
                 if (pars.Length != 2)
                     throw new ArgumentException("The -r option was not specified correctly");
                 reportName = pars[0];
                 reportUserName = pars[1];
                 searchSpec = SearchSpec.Report;
                 rOptionFound = true;
                 break;
             case "-f":
                 if (rOptionFound || fOptionFound)
                     throw new ArgumentException("Either the -r option or the -f option can only be specified once");
                 if (pars.Length != 1)
                     throw new ArgumentException("The -f option was not specified correctly");
                 findQuery = pars[0];
                 searchSpec = SearchSpec.FindQuery;
                 fOptionFound = true;
                 break;
             case "-o":
                 if (oOptionFound)
                     throw new ArgumentException("The -o option can only be specified once");
                 if (pars.Length != 1)
                     throw new ArgumentException("The -o option was not specified correctly");
                 outputFileName = pars[0];
                 oOptionFound = true;
                 break;
             case "-h":
                 if (oOptionFound)
                     throw new ArgumentException("The -o option can only be specified once");
                 if (pars.Length != 1)
                     throw new ArgumentException("The -o option was not specified correctly");
                 outputFileName = pars[0];
                 oOptionFound = true;
                 break;
             default:
                 throw new ArgumentException("An unsupported option was specifed: " + option);
         }
     }
     return (cOptionFound && pOptionFound && oOptionFound && (rOptionFound || fOptionFound));
 }
コード例 #16
0
 internal List<Task> Find(string findString, EHPMReportViewType viewType)
 {
     List<Task> found = new List<Task>();
     HPMFindContext findContext = new HPMFindContext();
     HPMFindContextData data = SessionManager.Session.UtilPrepareFindContext(findString, UniqueID, viewType, findContext);
     HPMTaskEnum items = SessionManager.Session.TaskFind(data, EHPMTaskFindFlag.None);
     foreach (HPMUniqueID taskID in items.m_Tasks)
         found.Add(Task.GetTask(taskID, viewType));
     return found;
 }