public void RestoreDesignObjects(LimnorProject project) { if (_rootPointer != null) { project.SetTypedData <ClassPointer>(_classId, _rootPointer); } else { project.RemoveTypedData <ClassPointer>(_classId); } if (_pane != null) { project.SetTypedData <ILimnorDesignPane>(_classId, _pane); } else { project.RemoveTypedData <ILimnorDesignPane>(_classId); } if (_map != null) { project.SetTypedData <ObjectIDmap>(_classId, _map); } else { project.RemoveTypedData <ObjectIDmap>(_classId); } }
public static DesignObjects RemoveDesignObjects(LimnorProject project, UInt32 classId) { ClassPointer rootPointer = null; if (project.HasTypedData <ClassPointer>(classId)) { rootPointer = project.GetTypedData <ClassPointer>(classId); } ILimnorDesignPane pane = null; if (project.HasTypedData <ILimnorDesignPane>(classId)) { pane = project.GetTypedData <ILimnorDesignPane>(classId); } ObjectIDmap map = null; if (project.HasTypedData <ObjectIDmap>(classId)) { map = project.GetTypedData <ObjectIDmap>(classId); } DesignObjects obj = new DesignObjects(classId, rootPointer, pane, map); project.RemoveTypedData <ILimnorDesignPane>(classId); project.RemoveTypedData <ClassPointer>(classId); project.RemoveTypedData <ObjectIDmap>(classId); return(obj); }
public void GetParameters(string projectFile, string classFile) { bool loadedHere = false; LimnorProject _project = new LimnorProject(projectFile); XmlDocument doc = new XmlDocument(); doc.Load(classFile); UInt32 classId = XmlUtil.GetAttributeUInt(doc.DocumentElement, XmlTags.XMLATT_ClassID); ClassPointer appClassPointer = _project.GetTypedData <ClassPointer>(classId); if (appClassPointer == null) { loadedHere = true; appClassPointer = ClassPointer.CreateClassPointer(_project, doc.DocumentElement); } if (appClassPointer.ObjectList.Count == 0) { appClassPointer.ObjectList.LoadObjects(); } _appCodeName = appClassPointer.CodeName; LimnorWebApp webapp = appClassPointer.ObjectInstance as LimnorWebApp; if (webapp != null) { _sessionVarCount = webapp.GlobalVariables.Count; if (webapp.GlobalVariables.Count > 0) { Dictionary <string, string> sessionVars = new Dictionary <string, string>(); foreach (SessionVariable sv in webapp.GlobalVariables) { if (!sessionVars.ContainsKey(sv.Name)) { if (!sv.Value.IsDefaultValue()) { sessionVars.Add(sv.Name, sv.Value.GetValueString()); } } } _sessionVarNames = new string[sessionVars.Count]; _sessionVarValues = new string[sessionVars.Count]; int idx = 0; foreach (KeyValuePair <string, string> kv in sessionVars) { _sessionVarNames[idx] = kv.Key; _sessionVarValues[idx] = kv.Value; idx++; } } _sessionTimeoutMinutes = webapp.GlobalVariableTimeout; if (_sessionTimeoutMinutes <= 0) { _sessionTimeoutMinutes = 20; } } if (loadedHere) { _project.RemoveTypedData <ClassPointer>(classId); } }
public void RemoveTypedData <T>() { _project.RemoveTypedData <T>(ClassId); }