Changeset 1091 for Scheduling


Ignore:
Timestamp:
Jan 27, 2011, 8:24:20 AM (14 years ago)
Author:
Sam Habiel
Message:
 
Location:
Scheduling/trunk/cs/bsdx0200GUISourceCode
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs

    r1083 r1091  
    4141        private BMXNetConnectInfo.BMXNetEventDelegate CDocMgrEventDelegate;     // Delegate to respond to messages from VISTA. Responds to event: BMXNetConnectInfo.BMXNetEvent
    4242
     43        //Custom Printing
     44        private CustomPrinting                          m_PrintingObject = null;
    4345                #endregion
    4446
     
    132134        }
    133135
    134 
     136        public CustomPrinting PrintingObject
     137        {
     138            get
     139            {
     140                return this.m_PrintingObject;
     141            }
     142        }
    135143        #endregion
    136144
     
    413421                        }while (bRetry == true);
    414422           
     423            //Printing
     424
     425            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(Application.StartupPath + @"\Printing\");
     426            System.IO.FileInfo[] rgFiles = di.GetFiles("*.dll");
     427            string DllLocation = string.Empty;
     428            foreach (System.IO.FileInfo fi in rgFiles)
     429            {
     430                DllLocation = fi.FullName;
     431            }
     432
     433            PrintingCreator Creator = null;
     434            if (DllLocation == string.Empty)
     435            {
     436                this.m_PrintingObject = new CustomPrinting();
     437            }
     438            else
     439            {
     440                System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFrom(DllLocation);
     441                foreach (Type type in assembly.GetTypes())
     442                {
     443                    if (type.IsClass == true & type.BaseType == typeof(PrintingCreator))
     444                    {
     445                        Creator = (PrintingCreator)Activator.CreateInstance(type);
     446                        break;
     447                    }
     448                }
     449                this.m_PrintingObject = Creator.PrintFactory();
     450            }
     451           
    415452            //Create global dataset
    416453                        _current.m_dsGlobal = new DataSet("GlobalDataSet");
Note: See TracChangeset for help on using the changeset viewer.