private GroupTask GenerateGroupTask(GroupContent groupContent, PM_Task task)
        {
            GroupTask taskObject = UtilityMethod.CreateObjectToParent(groupContent.transform, GroupTaskPrefab).GetComponent <GroupTask>();


            return(taskObject);
        }
        private GroupContent GenerateGroupContent(PM_Group group)
        {
            GroupContent contentObject = UtilityMethod.CreateObjectToParent(GanttRightPanel, GroupContentPrefab).GetComponent <GroupContent>();


            return(contentObject);
        }
        private void GenerateGanttChart(PM_Picture picture)
        {
            UtilityMethod.ClearChildObject(GanttLeftPanel);
            UtilityMethod.ClearChildObject(GanttRightPanel);

            foreach (PM_Group group in picture.groups)
            {
                GroupTitle title = GenerateGroupTitle(group);

                GroupContent content = GenerateGroupContent(group);

                int contentHeight = 0;
                int taskLength    = group.tasks.Length;
                for (int i = 0; i < taskLength; i++)
                {
                    PM_Task   task      = group.tasks[i];
                    GroupTask groupTask = GenerateGroupTask(content, task);

                    Debug.Log("Task time " + task.start_time + " , duration " + task.duration);

                    Vector2 anchoredPos = groupTask.rectTran.anchoredPosition;
                    float   baseAnchorX = task.duration / 2f;

                    groupTask.rectTran.anchoredPosition = new Vector2(pm_utility.GetTimeToWorldValue(task.start_time) + baseAnchorX, anchoredPos.y - contentHeight);
                    SetObjectSize(groupTask, new Vector2(pm_utility.GetTimeToWorldValue(task.duration), groupTask.rectTran.sizeDelta.y));
                    contentHeight += (int)groupTask.rectTran.sizeDelta.y;
                }

                SetObjectSize(content, new Vector2(content.rectTran.sizeDelta.x, contentHeight));
                SetObjectSize(title, new Vector2(title.rectTran.sizeDelta.x, contentHeight));
            }
        }
 internal XdrBuilder(XmlReader reader, XmlNamespaceManager curmgr, SchemaInfo sinfo, string targetNamspace, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventhandler)
 {
     this._SchemaInfo = sinfo;
     this._TargetNamespace = targetNamspace;
     this._reader = reader;
     this._CurNsMgr = curmgr;
     this.validationEventHandler = eventhandler;
     this._StateHistory = new HWStack(10);
     this._ElementDef = new ElementContent();
     this._AttributeDef = new AttributeContent();
     this._GroupStack = new HWStack(10);
     this._GroupDef = new GroupContent();
     this._NameTable = nameTable;
     this._SchemaNames = schemaNames;
     this._CurState = S_SchemaEntries[0];
     this.positionInfo = PositionInfo.GetPositionInfo(this._reader);
     this.xmlResolver = new XmlUrlResolver();
 }
示例#5
0
 internal static void Copy(GroupContent from, GroupContent to)
 {
     to._MinVal = from._MinVal;
     to._MaxVal = from._MaxVal;
     to._Order = from._Order;
 }
示例#6
0
 private void PopGroupInfo()
 {
     _GroupDef = (GroupContent)_GroupStack.Pop();
     Debug.Assert(_GroupDef != null);
 }
示例#7
0
 internal static GroupContent Copy(GroupContent other)
 {
     GroupContent g = new GroupContent();
     Copy(other, g);
     return g;
 }
 private void PopGroupInfo()
 {
     this._GroupDef = (GroupContent) this._GroupStack.Pop();
 }
示例#9
-1
 internal XdrBuilder(
                    XmlReader reader,
                    XmlNamespaceManager curmgr,
                    SchemaInfo sinfo,
                    string targetNamspace,
                    XmlNameTable nameTable,
                    SchemaNames schemaNames,
                    ValidationEventHandler eventhandler
                    )
 {
     _SchemaInfo = sinfo;
     _TargetNamespace = targetNamspace;
     _reader = reader;
     _CurNsMgr = curmgr;
     _validationEventHandler = eventhandler;
     _StateHistory = new HWStack(StackIncrement);
     _ElementDef = new ElementContent();
     _AttributeDef = new AttributeContent();
     _GroupStack = new HWStack(StackIncrement);
     _GroupDef = new GroupContent();
     _NameTable = nameTable;
     _SchemaNames = schemaNames;
     _CurState = s_schemaEntries[0];
     _positionInfo = PositionInfo.GetPositionInfo(_reader);
     _xmlResolver = null;
 }