Exemplo n.º 1
0
        public virtual void LoadAvailableLibraries()
        {
            lock (_catalog.Libraries)
            {
                _catalog.UpdateTimeStamp();
                InternalLoadAvailableLibraries();

                // Create the implicit system library
                Schema.Library systemLibrary = new Schema.Library(SystemLibraryName);
                systemLibrary.Files.Add(new Schema.FileReference("Alphora.Dataphor.DAE.dll", true));
                Version version = AssemblyNameUtility.GetVersion(typeof(Engine).Assembly.FullName);                 // HACK: Have to use this instead of Assembly.GetName() to work around Silverlight security
                systemLibrary.Version           = new VersionNumber(version.Major, version.Minor, version.Build, version.Revision);
                systemLibrary.DefaultDeviceName = TempDeviceName;
                _catalog.Libraries.Add(systemLibrary);
            }
        }
Exemplo n.º 2
0
        public static SettingsList GetClasses()
        {
            SettingsList classes = new SettingsList();

            Type[] types = typeof(DAERegister).Assembly.GetTypes();

            foreach (Type type in types)
            {
                // Nodes
                if (type.IsSubclassOf(typeof(PlanNode)))
                {
                    classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName));
                }

                // Devices
                if (type.IsSubclassOf(typeof(Schema.Device)))
                {
                    classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName));
                }

                // Conveyors
                if (type.IsSubclassOf(typeof(Conveyor)))
                {
                    classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName));
                }

                // DeviceOperator
                if (type.IsSubclassOf(typeof(Schema.DeviceOperator)))
                {
                    classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName));
                }

                // DeviceScalarType
                if (type.IsSubclassOf(typeof(Schema.DeviceScalarType)))
                {
                    classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName));
                }
            }

            return(classes);
        }
Exemplo n.º 3
0
 /// <summary> Determines the element namespace to use when writing the specified type. </summary>
 protected virtual string GetElementNamespace(Type type)
 {
     return(String.Format("{0},{1}", type.Namespace, AssemblyNameUtility.GetName(type.Assembly.FullName)));
 }