private static void addDocsInZip(List <ImportResult> results, ZipBuilder builder, string folder, InfoUtente infoUtente) { foreach (ImportResult temp in results) { try { List <BaseInfoDoc> infos = DocManager.GetBaseInfoForDocument(temp.DocNumber, null, null); BaseInfoDoc doc = infos[0]; FileRequest req = new FileRequest(); if (doc != null && !string.IsNullOrEmpty(doc.VersionLabel)) { logger.Debug("addDocsInZip GetBaseInfoForDocument VersionId " + doc.VersionLabel); } req.versionId = doc.VersionId; req.docNumber = doc.IdProfile; req.versionLabel = doc.VersionLabel; req.path = doc.Path; req.version = doc.VersionLabel; req.fileName = doc.FileName; FileDocumento fileDocumento = BusinessLogic.Documenti.FileManager.getFile(req, infoUtente); string extension = fileDocumento.fullName.Substring(fileDocumento.fullName.LastIndexOf(".") + 1); builder.AddEntry(temp.DocNumber + "." + extension, new string[] { folder }, fileDocumento.content); } catch (Exception e) { } } }
static public StringCollection GetAreaNames() { LevelDoc lvld = (LevelDoc)DocManager.GetActiveDocument(typeof(LevelDoc)); IMapItem[] ami = lvld.MapItems; ArrayList al = new ArrayList(); foreach (IMapItem mi in ami) { if (!(mi is Area)) { continue; } al.Add(((Area)mi).Name); } al.Add("[LastDiscovery]"); al.Sort(); StringCollection strc = new StringCollection(); foreach (string str in al) { strc.Add(str); } return(strc); }
/// <summary> /// 이니셜라이저 /// </summary> /// <param name="f"></param> public void Initialize(Form1 f, DocManager docManager) { this.ActiveTool = Q_Modeler.DrawArea.DrawToolType.Pointer; // // this.Location = new System.Drawing.Point(24, 79); this.Name = "drawArea"; // this.NetRectangle = new System.Drawing.Rectangle(0, 0, 0, 0); // this.Size = new System.Drawing.Size(272, 107); // this.TabIndex = 1; // this.Mgr.Gudcon = new GudCon(); this.Mgr.Gudsrt = new GudSrt(); this.Mgr.Gudpnt = new GudPnt(); this.Mgr.Gudsrt.GridpointX = 1; this.Mgr.Gudsrt.GridpointY = 1; this.Owner = f; this.DocManager = docManager; SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); Mgr.Flolist = new FLOList(); tools = new Tool[(int)DrawToolType.NumberOfDrawTools]; tools[(int)DrawToolType.Pointer] = new ToolPointer(); tools[(int)DrawToolType.Hand] = new ToolHand(); tools[(int)DrawToolType.Buffer] = new ToolBuffer(); tools[(int)DrawToolType.Operation] = new ToolOperation(); tools[(int)DrawToolType.Resource] = new ToolResource(); tools[(int)DrawToolType.Calendar] = new ToolCalendar(); tools[(int)DrawToolType.Demand] = new ToolDemand(); tools[(int)DrawToolType.Connection] = new ToolConnection(); }
/// <summary> /// Initialization /// </summary> /// <param name="owner">Reference to the owner form</param> /// <param name="docManager">Reference to Document manager</param> public void Initialize(MainForm owner, DocManager docManager, Image initialImage, string initialImageAsFilePath, byte[] initialImageAsPngBytes) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); Invalidate(); // Keep reference to owner form Owner = owner; DocManager = docManager; // set default tool activeTool = DrawToolType.Pointer; // Create undo manager undoManager = new UndoManager(_layers); // create array of drawing tools tools = new Tool[(int)DrawToolType.NumberOfDrawTools]; tools[(int)DrawToolType.Pointer] = new ToolPointer(); tools[(int)DrawToolType.Rectangle] = new ToolRectangle(); tools[(int)DrawToolType.Ellipse] = new ToolEllipse(); tools[(int)DrawToolType.Line] = new ToolLine(); tools[(int)DrawToolType.PolyLine] = new ToolPolyLine(); tools[(int)DrawToolType.Polygon] = new ToolPolygon(); tools[(int)DrawToolType.Text] = new ToolText(); tools[(int)DrawToolType.Image] = new ToolImage(); tools[(int)DrawToolType.Connector] = new ToolConnector(); LineColor = Color.Red; FillColor = Color.White; LineWidth = 5; LoadInitialImage(initialImage, initialImageAsFilePath, initialImageAsPngBytes, null); }
private void InitializeHelperObjects() { // DocManager DocManagerData data = new DocManagerData(); data.FormOwner = this; data.UpdateTitle = true; data.FileDialogFilter = "MaBongPal files (*.mbp)|*.mbp|All Files (*.*)|*.*"; data.NewDocName = "Untitled.mbp"; data.RegistryPath = registryPath; docManager = new DocManager(data); docManager.RegisterFileType("mbp", "mbpfile", "MaBongPal File"); docManager.SaveEvent += new SaveEventHandler(docManager_SaveEvent); docManager.LoadEvent += new LoadEventHandler(docManager_LoadEvent); docManager.OpenEvent += new OpenFileEventHandler(docManager_OpenEvent); docManager.DocChangedEvent += new EventHandler(docManager_DocChangedEvent); docManager.ClearEvent += new EventHandler(docManager_ClearEvent); docManager.NewDocument(); // DragDropManager dragDropManager = new DragDropManager(this); dragDropManager.FileDroppedEvent += new FileDroppedEventHandler(this.dragDropManager_FileDroppedEvent); // MruManager mruManager = new MruManager(); mruManager.Initialize(this, menuFileRecentFiles, registryPath); mruManager.MruOpenEvent += new MruFileOpenEventHandler(mruManager_MruOpenEvent); // ODSExporter odsExporter = new ODSExporter(); }
public void CCHDocumentRepository_Create() { var contactID = 1323; var centralDAL = new DAL("0"); var docManager = new DocManager(centralDAL); var sut = new CCHDocumentRepository(docManager, contactID); }
/// <summary> /// Initialization /// </summary> /// <param name="owner"></param> /// <param name="docManager"></param> public void Initialize(MainForm owner, DocManager docManager) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); // Keep reference to owner form this.Owner = owner; this.DocManager = docManager; // set default tool activeTool = DrawToolType.Pointer; // create list of graphic objects GraphicsList = new GraphicsList(); // Create undo manager undoManager = new UndoManager(GraphicsList); // create array of drawing tools tools = new Tool[(int)DrawToolType.NumberOfDrawTools]; tools[(int)DrawToolType.Pointer] = new ToolPointer(); tools[(int)DrawToolType.Rectangle] = new ToolRectangle(); tools[(int)DrawToolType.Ellipse] = new ToolEllipse(); tools[(int)DrawToolType.Line] = new ToolLine(); tools[(int)DrawToolType.Polygon] = new ToolPolygon(); //AdjustRendering(); this.initialized = true; }
public void TestDocManager() { string resourceDir = "TestResources"; string outputDir = "..\\..\\TestOutput"; DocManager docManager = new DocManager(); XDocument doc = XDocument.Load($"{resourceDir}\\vsxmd.xml"); var m = docManager.GenerateMembers(doc).OfType <TypeMember>().ToList(); }
public void CCHDocumentRepository_Upload() { string path = @"C:\scratch\Cloud-Readiness-v012.docx"; var contactID = 1323; var centralDAL = new DAL("0"); var docManager = new DocManager(centralDAL); var sut = new CCHDocumentRepository(docManager, contactID); sut.UploadDocument(path); }
public void CCHDocumentRepository_GetDocuments() { var contactID = 1323; var centralDAL = new DAL("0"); var docManager = new DocManager(centralDAL); var sut = new CCHDocumentRepository(docManager, contactID); var docs = sut.GetDocuments(); Assert.AreNotEqual(0, docs.Count()); }
public void MultiSelect(DocManager dm, docDB.DocumentRow dr) { multiSelect = true; multiDoc = dr; pnlBF.Closed = false; pnlAuthor.Closed = true; pnlRecipients.Closed = true; buttonOK.Enabled = false; ucRecipientTextBox1.Init(dm, dr); }
public static StringCollection GetCounterNames() { LevelDoc lvld = (LevelDoc)DocManager.GetActiveDocument(typeof(LevelDoc)); StringCollection strc = new StringCollection(); foreach (Counter ctr in lvld.CounterManager.Items) { strc.Add(ctr.Name); } return(strc); }
public static StringCollection GetSwitchNames() { LevelDoc lvld = (LevelDoc)DocManager.GetActiveDocument(typeof(LevelDoc)); StringCollection strc = new StringCollection(); foreach (Switch sw in lvld.SwitchManager.Items) { strc.Add(sw.Name); } return(strc); }
StringCollection GetUnitGroupNames() { LevelDoc lvld = (LevelDoc)DocManager.GetActiveDocument(typeof(LevelDoc)); StringCollection strc = new StringCollection(); foreach (UnitGroup ug in lvld.UnitGroupManager.Items) { strc.Add(ug.Name); } return(strc); }
// New file .meg public void NewMeg() { int x = TheLayers.ActiveLayerIndex; CommandDeleteAll command = new CommandDeleteAll(TheLayers); if (TheLayers[x].Graphics.Clear()) { Refresh(); } ClearHistory(); DocManager.NewDocument(); }
public void CCHDocumentRepository_Download() { string path = @"C:\scratch"; var contactID = 1323; var centralDAL = new DAL("0"); var docManager = new DocManager(centralDAL); var sut = new CCHDocumentRepository(docManager, contactID); var docs = sut.GetDocuments(); Assert.AreNotEqual(0, docs.Count()); int documentID = docs.First().DocumentID; sut.DownloadDocument(documentID, path); }
private void LoadRootFile(int RootFileid) { ucBrowse1.LoadRoot(myAtmng, RootFileid, false, false, false); DocManager myDM = myAtmng.GetFile(RootFileid).GetDocMng(); timFMHeartbeat.Start(); //now loaded in docmanager constructor //myDM.GetDocument().LoadByFileId(ucBrowse1.SelectedFile.FileId); //myDM.GetRecipient().LoadByFileId(ucBrowse1.SelectedFile.FileId); ucRecords1.FM = myDM.FM; ucRecords1.BindDocumentData(myDM.DB.Document, false, myDM); }
public void Execute() { if (!CheckDocumento()) { return; } List <FileRequest> versions = GetVersions(_sd); _numVersionRemoved = 0; if (versions.Count > Index) { for (int i = Index; i < versions.Count; i++) { bool resTemp = VersioniManager.removeVersion(versions[i], _infoUtente); if (!resTemp) { _error = "Errore nella rimozione della versione " + versions[i].version + " del documento"; return; } else { _numVersionRemoved++; } } } foreach (Allegato all in _sd.allegati) { SchedaDocumento allSd = DocManager.getDettaglio(_infoUtente, null, all.docNumber); List <FileRequest> versionsAll = GetVersions(allSd); if (versionsAll.Count > Index) { for (int i = Index; i < versionsAll.Count; i++) { bool resTemp = VersioniManager.removeVersion(versionsAll[i], _infoUtente); if (!resTemp) { _error = "Errore nella rimozione della versione " + versionsAll[i].version + " dell'allegato " + allSd.docNumber; return; } else { _numVersionRemoved++; } } } } if (_numVersionRemoved == 0) { _error = "Il documento non ha versioni da eliminare"; } }
public fDocView(DocManager dm, lmDatasets.docDB.DocumentRow dr) { InitializeComponent(); if (dr == null) { Close(); return; } this.Text = String.Format(Properties.Resources.AppDocViewer, dm.AtMng.AppMan.AppName); ucDocView1.Init(dm); ucDocView1.ActionToolbarView = UserControls.DocCommandBar.Hide; ucDocView1.Datasource = new DataView(dr.Table, "Docid=" + dr.DocId.ToString(), "", DataViewRowState.CurrentRows); }
public override string FromSaveString(string strArgs, bool fLast) { Regex re = new Regex(@"^(?<index>(-)?\d+)(?<end>.*)$"); Match m = re.Match(strArgs); int index = int.Parse(m.Groups["index"].Value); LevelDoc lvld = (LevelDoc)DocManager.GetActiveDocument(typeof(LevelDoc)); if (index >= 0 && index < lvld.UnitGroupManager.Items.Count) { m_ug = (UnitGroup)lvld.UnitGroupManager.Items[index]; m_fInit = true; } return(m.Groups["end"].Value); }
public fBrowseDocs(atriumManager atmng) { InitializeComponent(); myAtmng = atmng; myDM = myAtmng.GetFile().GetDocMng(); ucBrowse1.LoadRoot(atmng, 0, false, false, true); ucRecordList1.SelectionMode = Janus.Windows.GridEX.SelectionMode.MultipleSelection; LoadDocs(); //tvMyFiles.ExpandAll(); lblCurrentFile.Text = ""; panelDisplayHandler(Properties.Resources.Browse, Properties.Resources.folder); }
public override string FromSaveString(string strArgs, bool fLast) { Regex re = new Regex(@"^(?<index>(-)?\d+)(?<end>.*)$"); Match m = re.Match(strArgs); int index = int.Parse(m.Groups["index"].Value); StringCollection strc = GetSwitchNames(); if (index >= 0 && index < strc.Count) { LevelDoc lvld = (LevelDoc)DocManager.GetActiveDocument(typeof(LevelDoc)); m_sw = lvld.SwitchManager[strc[index]]; m_fInit = true; } return(m.Groups["end"].Value); }
private void InitializeHelperObjects() { int x = drawArea.TheLayers.ActiveLayerIndex; // DocManager DocManagerData data = new DocManagerData(); //HAMID //data.FormOwner = tempOwner; data.UpdateTitle = true; data.FileDialogFilter = "Genetibase.NuGenAnnotation files (*.dtl)|*.dtl|All Files (*.*)|*.*"; data.NewDocName = "Untitled.dtl"; //data.RegistryPath = registryPath; docManager = new DocManager(data); docManager.RegisterFileType("dtl", "dtlfile", "Genetibase.NuGenAnnotation File"); // Subscribe to DocManager events. //docManager.SaveEvent += docManager_SaveEvent; //docManager.LoadEvent += docManager_LoadEvent; docManager.DocChangedEvent += delegate(object o, EventArgs e) { drawArea.Refresh(); drawArea.ClearHistory(); }; docManager.ClearEvent += delegate(object o, EventArgs e) { bool haveObjects = false; for (int i = 0; i < drawArea.TheLayers.Count; i++) { if (drawArea.TheLayers[i].Graphics.Count > 1) { haveObjects = true; break; } } if (haveObjects) { drawArea.TheLayers.Clear(); drawArea.ClearHistory(); drawArea.Refresh(); } }; docManager.NewDocument(); }
public void ConfigDirTest() { var manager = new DocManager(); manager.ConfigDir(fixture.ActiveQMSDocuments.FullName); Assert.AreEqual(fixture.ActiveQMSDocuments.FullName, manager.Dir.FullName); Assert.AreEqual( Path.Combine(fixture.Dir.FullName, "Processing"), manager.ProcessingDir.FullName ); Assert.AreEqual( manager.Dir.FullName, fixture.ActiveQMSDocuments.FullName ); manager.Dispose(); }
public fDoc(DocManager dm, lmDatasets.docDB.DocumentRow dr) { InitializeComponent(); if (dr == null) { Close(); return; } this.Text = String.Format(Properties.Resources.AppDocViewer, dm.AtMng.AppMan.AppName); ucDoc1.Init(dm); ucDoc1.AllowActionToolbar = false; //ucDoc1.AllowUserCompose = false; //ucDoc1.ReadOnly(true); ucDoc1.Datasource = new DataView(dr.Table, "Docid=" + dr.DocId.ToString(), "", DataViewRowState.CurrentRows); }
public override bool EditProperties() { StringCollection strc = GetUnitTypeNames(); string strName = m_ut != UnitType.kutNone ? Helper.GetDisplayName(typeof(UnitType), m_ut.ToString()) : ""; int n = PickListForm.DoModal("Unit Type", strName, strc); if (n == -1) { return(false); } LevelDoc lvld = (LevelDoc)DocManager.GetActiveDocument(typeof(LevelDoc)); m_ut = (UnitType)n; m_fInit = true; return(true); }
public override bool EditProperties() { StringCollection strc = GetUnitGroupNames(); string strName = m_ug != null ? m_ug.Name : ""; int n = PickListForm.DoModal("Unit Group", strName, strc); if (n == -1) { return(false); } LevelDoc lvld = (LevelDoc)DocManager.GetActiveDocument(typeof(LevelDoc)); m_ug = (UnitGroup)lvld.UnitGroupManager.Items[n]; m_fInit = true; return(true); }
public void LoadClient(int ClientId, ICSSHost Host) { // construct APIs var centralDal = CssContext.Instance.GetDAL(string.Empty) as DAL; var docManager = new DocManager(centralDal); var centralGateway = new CentralGateway(centralDal); var client = centralGateway.FindClient(ClientId, CssContext.Instance.Host.EmployeeId); client.Assignments.Add(new Assignment() { }); _contactID = client.Contact.ContactId; _documentRepo = new CCHDocumentRepository(docManager, client.Contact.ContactId); RefreshData(); }
public MainForm() { InitializeComponent(); g = this.CreateGraphics(); DocManagerData data = new DocManagerData(); data.FormOwner = this; data.UpdateTitle = true; data.FileDialogFilter = "DrawTools files (*.dtl)|*.dtl|All Files (*.*)|*.*"; data.NewDocName = "Untitled.dtl"; docManager = new DocManager(data); docManager.RegisterFileType("dtl", "dtlfile", "DrawTools File"); this.Cursor = Cursors.Cross; drawArea.Location = new System.Drawing.Point(0, 0); drawArea.Size = new System.Drawing.Size(200, 200); drawArea.Owner = this; drawArea.Visible = false; drawArea.Initialize(this, docManager); GraphicsProperties graphicProperties = drawArea.GraphicsList.GetProperties(); this.myColorPicker.SelectedColor = DrawSettings.LastUsedColor; this.myColorPicker.PenWidth = graphicProperties.PenWidth; this.drawArea.ToolTextBox.ForeColor = DrawSettings.LastUsedColor; this.myColorPicker.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { GraphicsProperties p = new GraphicsProperties(); p.Color = e.Color; p.PenWidth = e.Width; this.drawArea.ToolTextBox.ForeColor = e.Color.Value; this.drawArea.ToolTextBox.Font = new System.Drawing.Font("Arial Narrow", e.TextSize); if (drawArea.GraphicsList.ShowColorPickerPanel(drawArea, p)) { drawArea.SetDirty(); drawArea.Refresh(); } }; }
/// <summary> /// Funzione per la generazione di una nuova riga del report /// </summary> /// <param name="dataRow">DataRow da cui estrarre i dati per inizializzare la riga</param> /// <param name="reportHeader">Header del report</param> /// <returns>Riga inizializzata</returns> private ReportMapRowProperty GenerateNewRow(DataRow dataRow, HeaderColumnCollection reportHeader) { ReportMapRowProperty row = new ReportMapRowProperty(); // Aggiunta dell'id del documento row.Columns.Add(this.GenerateHeaderColumn(dataRow["IdDoc"].ToString(), "Segn. proto. / Id doc.", "IDDOC")); // Aggiunta dell'oggetto row.Columns.Add(this.GenerateHeaderColumn(dataRow["Oggetto_Documento"].ToString(), "Oggetto", "oggetto_documento")); String dataAnnullamento = String.Empty; // Aggiunta della segnatura di repertorio row.Columns.Add(this.GenerateHeaderColumn( DocManager.GetSegnaturaRepertorio(dataRow["DocNumber"].ToString(), dataRow["IdAmm"].ToString(), false, out dataAnnullamento), "Segn. repertorio", "Segn. repertorio")); // Aggiunta della data di repertorio row.Columns.Add(this.GenerateHeaderColumn(dataRow["Data_Di_Repertorio"].ToString(), "Data repertorio", "data_di_repertorio")); // Aggiunta della data di annullamento row.Columns.Add(this.GenerateHeaderColumn(dataAnnullamento, "Data annullamento", "data_annullamento")); // Aggiunta dell'impronta row.Columns.Add(this.GenerateHeaderColumn(dataRow["Impronta"].ToString(), "Impronta", "Impronta")); // Aggiunta del campo profilato con rispettivo valore (solo se il campo ha lo storico attivo) if (dataRow["EnabledHistory"].ToString() == "1") { if (reportHeader[dataRow["Descrizione_Campo_Profilato"].ToString() + dataRow["ObjectId"].ToString()] == null) { reportHeader.Add(new HeaderProperty() { ColumnName = dataRow["Descrizione_Campo_Profilato"].ToString(), OriginalName = dataRow["Descrizione_Campo_Profilato"].ToString() + dataRow["ObjectId"].ToString() }); } String value = dataRow["ObjType"].ToString().ToLower() == "corrispondente" && !String.IsNullOrEmpty(dataRow["Valore"].ToString()) ? BusinessLogic.Utenti.UserManager.GetRoleDescriptionByIdCorrGlobali(dataRow["Valore"].ToString()) : dataRow["Valore"].ToString(); row.Columns.Add(this.GenerateHeaderColumn(value, dataRow["Descrizione_Campo_Profilato"].ToString(), dataRow["Descrizione_Campo_Profilato"].ToString() + dataRow["ObjectId"].ToString())); } return(row); }
public static void start(){ Debug.Log ("start document generator "); Debug.Log (System.Environment.CurrentDirectory); string path = System.Environment.CurrentDirectory +"/Assets/JOKER/Scripts/Novel/Components/"; //指定フォルダ以下のディレクトリ全部読み込み string[] files = System.IO.Directory.GetFiles( path, "*", System.IO.SearchOption.AllDirectories); List<string > arrDoc = new List<string> (); for (var i = 0; i < files.Length; i++) { System.Console.WriteLine (files [i]); System.IO.StreamReader cReader = ( new System.IO.StreamReader(files[i], System.Text.Encoding.Default) ); bool flag_doc = false; // 読み込みできる文字がなくなるまで繰り返す while (cReader.Peek () >= 0) { // ファイルを 1 行ずつ読み込む string stBuffer = cReader.ReadLine ().Trim (); if (stBuffer == "") { continue; } if (stBuffer == "[doc]") { flag_doc = true; } if (flag_doc == true) { arrDoc.Add(stBuffer); } if (stBuffer == "[_doc]") { flag_doc = false; } } // cReader を閉じる (正しくは オブジェクトの破棄を保証する を参照) cReader.Close(); } DocManager dm = new DocManager (); //パーサーを動作させる foreach (string doc in arrDoc) { System.Console.WriteLine (doc); dm.addInfo (doc); } dm.showInfo (); }
public CCHDocumentRepository(DocManager cchDocumentAPI, int contactID) { _cchDocumentAPI = cchDocumentAPI; _contactID = contactID; }
/// <summary> /// Initialization /// </summary> /// <param name="owner"> </param> /// <param name="docManager"> </param> public void Initialize(MainForm owner, DocManager docManager) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); // Keep reference to owner form // this.Owner = owner; // this.DocManager = docManager; // set default tool _activeTool = DrawToolType.Pointer; // create list of graphic objects _graphicsList = new GraphicsList(); // Create undo manager _undoManager = new UndoManager(_graphicsList); // create array of drawing tools _tools = new Tool[(int) DrawToolType.NumberOfDrawTools]; _tools[(int) DrawToolType.Pointer] = new ToolPointer(); _tools[(int) DrawToolType.Rectangle] = new ToolRectangle(); _tools[(int) DrawToolType.Ellipse] = new ToolEllipse(); _tools[(int) DrawToolType.Line] = new ToolLine(); _tools[(int) DrawToolType.Polygon] = new ToolPolygon(); }